open.2: Note some further advantages of the *at() APIs

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-06-27 08:54:09 +02:00
parent 70376041ca
commit 941d289252
1 changed files with 11 additions and 1 deletions

View File

@ -1454,7 +1454,17 @@ argument of (say)
.BR fstatat (2)
and
.BR openat ().
The use of the
.I dirfd
file descriptor also has other benefits:
.IP * 3
the file descriptor is a stable reference to the directory,
even if the directory is renamed; and
.IP *
the open file descriptor prevents the underlying filesystem from
being dismounted,
just as when a process has a current working directory on a filesystem.
.PP
Second,
.BR openat ()
allows the implementation of a per-thread "current working