link.2: Glibc falls back to link() on kernels that lack linkat()

Unless 'flags' contains AT_SYMLINK_FOLLOW.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2014-05-16 10:37:03 +02:00
parent 1e40dbf524
commit c71a9ed732
1 changed files with 20 additions and 0 deletions

View File

@ -382,6 +382,26 @@ is dereferenced if it is a symbolic link.
For precise control over the treatment of symbolic links when
creating a link, use
.BR linkat (2).
.SS Glibc notes
On older kernels where
.BR linkat ()
is unavailable, the glibc wrapper function falls back to the use of
.BR link (),
unless the
.B AT_SYMLINK_FOLLOW
is specified.
When
.I oldpath
and
.I newpath
are relative pathnames,
glibc constructs pathnames based on the symbolic links in
.IR /proc/self/fd
that correspond to the
.I olddirfd
and
.IR newdirfd
arguments.
.SH BUGS
On NFS filesystems, the return code may be wrong in case the NFS server
performs the link creation and dies before it can say so.