diff mbox series

[13/14] getpwent_r.3: SYNOPSIS: Use 'restrict' in prototypes

Message ID 20210228004817.122463-14-alx.manpages@gmail.com
State Not Applicable
Headers show
Series man3: SYNOPSIS: Use 'restrict' in prototypes (batch 2) | expand

Commit Message

Alejandro Colomar \(man-pages\) Feb. 28, 2021, 12:48 a.m. UTC
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>
---
 man3/getpwent_r.3 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/man3/getpwent_r.3 b/man3/getpwent_r.3
index 3414b31a8..b2c7e420a 100644
--- a/man3/getpwent_r.3
+++ b/man3/getpwent_r.3
@@ -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