readlink.2: Glibc falls back to readlink() on kernels that lack readlinkat()

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

View File

@ -253,6 +253,19 @@ also addresses a common portability problem when using
for the buffer size,
as this constant is not guaranteed to be defined per POSIX
if the system does not have such limit.
.SS Glibc notes
On older kernels where
.BR readlinkat ()
is unavailable, the glibc wrapper function falls back to the use of
.BR readlink ().
When
.I pathname
is a relative pathname,
glibc constructs a pathname based on the symbolic link in
.IR /proc/self/fd
that corresponds to the
.IR dirfd
argument.
.SH EXAMPLE
The following program allocates the buffer needed by
.BR readlink ()