]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes
authorAlejandro Colomar <alx.manpages@gmail.com>
Sun, 28 Feb 2021 00:48:17 +0000 (01:48 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 3 Mar 2021 22:44:40 +0000 (23:44 +0100)
glibc uses 'restrict' in getpwent_r(), fgetpwent_r().
Let's use it here too.

.../glibc$ grep_glibc_prototype getpwent_r
pwd/pwd.h:139:
extern int getpwent_r (struct passwd *__restrict __resultbuf,
       char *__restrict __buffer, size_t __buflen,
       struct passwd **__restrict __result)
       __nonnull ((1, 2, 4));
.../glibc$ grep_glibc_prototype fgetpwent_r
pwd/pwd.h:166:
extern int fgetpwent_r (FILE *__restrict __stream,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result)
__nonnull ((1, 2, 3, 5));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/getpwent_r.3

index 3414b31a80ab9f8dadea9e3f2f2aadd4eea06366..b2c7e420a7c9b7a682d2dda4211519c2a02cc0f5 100644 (file)
@@ -28,10 +28,13 @@ getpwent_r, fgetpwent_r \- get passwd file entry reentrantly
 .nf
 .B #include <pwd.h>
 .PP
-.BI "int getpwent_r(struct passwd *" pwbuf ", char *" buf ,
-.BI "               size_t " buflen ", struct passwd **" pwbufp );
-.BI "int fgetpwent_r(FILE *" stream ", struct passwd *" pwbuf ", char *" buf ,
-.BI "                size_t " buflen ", struct passwd **" pwbufp );
+.BI "int getpwent_r(struct passwd *restrict " pwbuf ,
+.BI "               char *restrict " buf ", size_t " buflen ,
+.BI "               struct passwd **restrict " pwbufp );
+.BI "int fgetpwent_r(FILE *restrict " stream \
+", struct passwd *restrict " pwbuf ,
+.BI "               char *restrict " buf ", size_t " buflen ,
+.BI "               struct passwd **restrict " pwbufp );
 .fi
 .PP
 .RS -4