Skip to content

O_EMPTY_PATH for openat #47

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions