readlink.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-14 00:08:50 +02:00
parent f06a3f30fa
commit a539c872e1
1 changed files with 14 additions and 14 deletions

View File

@ -47,22 +47,22 @@ readlink, readlinkat \- read value of a symbolic link
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.sp
.PP
.BI "ssize_t readlink(const char *" pathname ", char *" buf \
", size_t " bufsiz );
.sp
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
.sp
.PP
.BI "ssize_t readlinkat(int " dirfd ", const char *" pathname ,
.BI " char *" buf ", size_t " bufsiz );
.sp
.PP
.fi
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.PP
.ad l
.BR readlink ():
.RS 4
@ -70,7 +70,7 @@ _XOPEN_SOURCE\ >=\ 500 || _POSIX_C_SOURCE\ >=\ 200112L
.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE
.RE
.sp
.PP
.BR readlinkat ():
.PD 0
.ad l
@ -104,7 +104,7 @@ The
system call operates in exactly the same way as
.BR readlink (),
except for the differences described here.
.PP
If the pathname given in
.I pathname
is relative, then it is interpreted relative to the directory
@ -114,7 +114,7 @@ referred to by the file descriptor
the calling process, as is done by
.BR readlink ()
for a relative pathname).
.PP
If
.I pathname
is relative and
@ -126,13 +126,13 @@ then
is interpreted relative to the current working
directory of the calling process (like
.BR readlink ()).
.PP
If
.I pathname
is absolute, then
.I dirfd
is ignored.
.PP
Since Linux 2.6.39,
.\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d
.I pathname
@ -225,7 +225,7 @@ library support was added to glibc in version 2.4.
.RB ( readlink ()
first appeared in 4.2BSD),
POSIX.1-2001, POSIX.1-2008.
.PP
.BR readlinkat ():
POSIX.1-2008.
.SH NOTES
@ -236,7 +236,7 @@ was declared as
Nowadays, the return type is declared as
.IR ssize_t ,
as (newly) required in POSIX.1-2001.
.PP
Using a statically sized buffer might not provide enough room for the
symbolic link contents.
The required size for the buffer can be obtained from the
@ -283,7 +283,7 @@ in cases where
.BR lstat (2)
reports a size of zero.
.PP
.nf
.EX
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
@ -346,7 +346,7 @@ main(int argc, char *argv[])
free(buf);
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR readlink (1),
.BR lstat (2),