[14/14] getpwnam.3: SYNOPSIS: Use 'restrict' in prototypes
Commit Message
POSIX does NOT specify these functions to use 'restrict'.
However, glibc uses 'restrict' in getpwnam_r(), getpwuid_r().
Let's use it here too.
.../glibc$ grep_glibc_prototype getpwnam_r
pwd/pwd.h:151:
extern int getpwnam_r (const char *__restrict __name,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result)
__nonnull ((1, 2, 3, 5));
.../glibc$ grep_glibc_prototype getpwuid_r
pwd/pwd.h:145:
extern int getpwuid_r (__uid_t __uid,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result)
__nonnull ((2, 3, 5));
.../glibc$
Cc: glibc <libc-alpha@sourceware.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/getpwnam.3 | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
@@ -45,10 +45,13 @@ getpwnam, getpwnam_r, getpwuid, getpwuid_r \- get password file entry
.BI "struct passwd *getpwnam(const char *" name );
.BI "struct passwd *getpwuid(uid_t " uid );
.PP
-.BI "int getpwnam_r(const char *" name ", struct passwd *" pwd ,
-.BI " char *" buf ", size_t " buflen ", struct passwd **" result );
-.BI "int getpwuid_r(uid_t " uid ", struct passwd *" pwd ,
-.BI " char *" buf ", size_t " buflen ", struct passwd **" result );
+.BI "int getpwnam_r(const char *restrict " name \
+", struct passwd *restrict " pwd ,
+.BI " char *restrict " buf ", size_t " buflen ,
+.BI " struct passwd **restrict " result );
+.BI "int getpwuid_r(uid_t " uid ", struct passwd *restrict " pwd ,
+.BI " char *restrict " buf ", size_t " buflen ,
+.BI " struct passwd **restrict " result );
.fi
.PP
.RS -4