Skip to content

O_EMPTY_PATH for openat #47

@swick

Description

@swick

If one has an O_PATH fd and wants to re-open an operable version, there are two options currently:

  • If fd refers to a directory openat (fd, ".", O_DIRECTORY | ...);
  • otherwise open ("/proc/self/fd/$FD", ...);

The dependency on procfs is not great. It would be nice if openat worked on an empty path.

FreeBSD has O_EMPTY_PATH for openat, and fstatat and others have AT_EMPTY_PATH.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions