mirror of https://github.com/mkerrisk/man-pages
open.2: Explain ways in which a 'directory file descriptor' can be obtained
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
aec13430b1
commit
96c44b8f50
16
man2/open.2
16
man2/open.2
|
@ -1665,6 +1665,22 @@ directory", via file descriptor(s) maintained by the application.
|
|||
on the use of
|
||||
.IR /proc/self/fd/ dirfd,
|
||||
but less efficiently.)
|
||||
.PP
|
||||
The
|
||||
.I dirfd
|
||||
argument for these APIs can be obtained by using
|
||||
.BR open ()
|
||||
or
|
||||
.BR openat ()
|
||||
to open a directory (with either the
|
||||
.BR O_RDONLY
|
||||
or the
|
||||
.BR O_PATH
|
||||
flag).
|
||||
Alternatively, such a file descriptor can be obtained by applying
|
||||
.BR dirfd (3)
|
||||
to a directory stream created using
|
||||
.BR opendir (3).
|
||||
.\"
|
||||
.\"
|
||||
.SS O_DIRECT
|
||||
|
|
Loading…
Reference in New Issue