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

POSIX specifies that the parameters of stat(), lstat(), and fstatat()
shall be 'restrict'.  Glibc uses 'restrict' too.
Let's use it here too.

......

.../glibc$ grep_glibc_prototype stat
io/sys/stat.h:205:
extern int stat (const char *__restrict __file,
		 struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype lstat
io/sys/stat.h:259:
extern int lstat (const char *__restrict __file,
		  struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype fstatat
io/sys/stat.h:234:
extern int fstatat (int __fd, const char *__restrict __file,
		    struct stat *__restrict __buf, int __flag)
     __THROW __nonnull ((2, 3));
.../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:22 +01:00 committed by Michael Kerrisk
parent 049d7f92e8
commit caed1954a1
1 changed files with 6 additions and 5 deletions

View File

@ -44,16 +44,17 @@ stat, fstat, lstat, fstatat \- get file status
.B #include <sys/types.h>
.B #include <sys/stat.h>
.PP
.BI "int stat(const char *" pathname ", struct stat *" statbuf );
.BI "int stat(const char *restrict " pathname ,
.BI " struct stat *restrict " statbuf );
.BI "int fstat(int " fd ", struct stat *" statbuf );
.BI "int lstat(const char *" pathname ", struct stat *" statbuf );
.BI "int lstat(const char *restrict " pathname ,
.BI " struct stat *restrict " statbuf );
.PP
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <sys/stat.h>
.PP
.BI "int fstatat(int " dirfd ", const char *" pathname ", struct stat *" \
statbuf ,
.BI " int " flags );
.BI "int fstatat(int " dirfd ", const char *restrict " pathname ,
.BI " struct stat *restrict " statbuf ", int " flags );
.fi
.PP
.RS -4