mirror of https://github.com/mkerrisk/man-pages
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:
parent
049d7f92e8
commit
caed1954a1
11
man2/stat.2
11
man2/stat.2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue