getpwnam.3: SYNOPSIS: Use 'restrict' in prototypes

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>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-02-28 01:48:18 +01:00 committed by Michael Kerrisk
parent 69b7afbe94
commit 4dfd2b4f70
1 changed files with 7 additions and 4 deletions

View File

@ -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