readlink.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies that the parameters of readlink() and readlinkat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype readlink
posix/unistd.h:820:
extern ssize_t readlink (const char *__restrict __path,
			 char *__restrict __buf, size_t __len)
     __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3));
.../glibc$ grep_glibc_prototype readlinkat
posix/unistd.h:832:
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
			   char *__restrict __buf, size_t __len)
     __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-02-14 00:10:14 +01:00 committed by Michael Kerrisk
parent 78eb47fc8f
commit 8f5b718ea1
1 changed files with 4 additions and 4 deletions

View File

@ -48,14 +48,14 @@ readlink, readlinkat \- read value of a symbolic link
.nf
.B #include <unistd.h>
.PP
.BI "ssize_t readlink(const char *" pathname ", char *" buf \
", size_t " bufsiz );
.BI "ssize_t readlink(const char *restrict " pathname ", char *restrict " buf ,
.BI " size_t " bufsiz );
.PP
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
.PP
.BI "ssize_t readlinkat(int " dirfd ", const char *" pathname ,
.BI " char *" buf ", size_t " bufsiz );
.BI "ssize_t readlinkat(int " dirfd ", const char *restrict " pathname ,
.BI " char *restrict " buf ", size_t " bufsiz );
.PP
.fi
.RS -4