Skip to content

Commit c1e04eb

Browse files
authored
Merge pull request #48 from swick/patch-2
wishlist: add AT_EMPTY_PATH to openat()
2 parents 336afba + 6fa11b2 commit c1e04eb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,19 @@ tells userspace that there was an fd, but it was not allowed through.
697697

698698
**Use-Case:** Any code that wants to use `SCM_RIGHTS` properly.
699699

700+
### `AT_EMPTY_PATH` support for `openat()` and `openat2()`
701+
702+
To get an operable version of an `O_PATH` file descriptors, it is
703+
possible to use `openat(fd, ".", O_DIRECTORY)` for directories, but
704+
other files currently require going through
705+
`open("/proc/<pid>/fd/<nr>")` which depends on a functioning `procfs`.
706+
707+
FreeBSD already has `O_EMPTY_PATH` for `openat`, while `fstatat` and
708+
similar functions have `AT_EMPTY_PATH`.
709+
710+
**Use-Case:** When dealing with `O_PATH` file descriptors, allow
711+
re-opening an operable version without the need of `procfs`.
712+
700713
---
701714

702715
## Finished Items

0 commit comments

Comments
 (0)