link.2: Tweaks to Andy Lutomirski's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2014-05-02 10:10:07 +02:00
parent 7dee406bc4
commit 4ec5bffac9
1 changed files with 12 additions and 10 deletions

View File

@ -135,8 +135,8 @@ is an empty string, create a link to the file referenced by
flag).
In this case,
.I olddirfd
can refer to any type of file, not just a directory. This will
generally not work if the file has a link count of zero (files
can refer to any type of file, not just a directory.
This will generally not work if the file has a link count of zero (files
created with
.BR O_TMPFILE
and without
@ -167,14 +167,16 @@ to cause
.I oldpath
to be dereferenced if it is a symbolic link.
If procfs is mounted,
this can be used as an alternative to AT_EMPTY_PATH, even by
unprivileged processes on Linux versions before 3.11, like this:
.RS
.PP
.EX
linkat(AT_FDCWD, "/proc/self/fd/<fd>", newdirfd, newname, AT_SYMLINK_FOLLOW);
.EE
.RE
this can be used as an alternative to
.BR AT_EMPTY_PATH ,
even by unprivileged processes on Linux versions before 3.11, like this:
.nf
.in +4n
linkat(AT_FDCWD, "/proc/self/fd/<fd>", newdirfd,
newname, AT_SYMLINK_FOLLOW);
.in
.fi
.PP
Before kernel 2.6.18, the
.I flags