POSIX does NOT specify these functions to use 'restrict'. However, glibc uses 'restrict' in getgrnam_r(), getgrgid_r(). Users might be surprised by this! Let's use it here too! .../glibc$ grep_glibc_prototype getgrnam_r grp/grp.h:148: extern int getgrnam_r (const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../glibc$ grep_glibc_prototype getgrgid_r grp/grp.h:140: extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); .../glibc$ Cc: glibc <libc-alpha@xxxxxxxxxxxxxx> Cc: Ulrich Drepper <drepper@xxxxxxxxxx> Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx> --- man3/getgrnam.3 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/man3/getgrnam.3 b/man3/getgrnam.3 index 87f61c260..1b13208ba 100644 --- a/man3/getgrnam.3 +++ b/man3/getgrnam.3 @@ -41,10 +41,13 @@ getgrnam, getgrnam_r, getgrgid, getgrgid_r \- get group file entry .BI "struct group *getgrnam(const char *" name ); .BI "struct group *getgrgid(gid_t " gid ); .PP -.BI "int getgrnam_r(const char *" name ", struct group *" grp , -.BI " char *" buf ", size_t " buflen ", struct group **" result ); -.BI "int getgrgid_r(gid_t " gid ", struct group *" grp , -.BI " char *" buf ", size_t " buflen ", struct group **" result ); +.BI "int getgrnam_r(const char *restrict " name \ +", struct group *restrict " grp , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct group **restrict " result ); +.BI "int getgrgid_r(gid_t " gid ", struct group *restrict " grp , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct group **restrict " result ); .fi .PP .RS -4 -- 2.30.1.721.g45526154a5