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

glibc uses 'restrict' in getservent_r(), getservbyname_r(),
getservbyport_r().
Let's use it here too.

.../glibc$ grep_glibc_prototype getservent_r
resolv/netdb.h:306:
extern int getservent_r (struct servent *__restrict __result_buf,
			 char *__restrict __buf, size_t __buflen,
			 struct servent **__restrict __result);
.../glibc$ grep_glibc_prototype getservbyname_r
resolv/netdb.h:310:
extern int getservbyname_r (const char *__restrict __name,
			    const char *__restrict __proto,
			    struct servent *__restrict __result_buf,
			    char *__restrict __buf, size_t __buflen,
			    struct servent **__restrict __result);
.../glibc$ grep_glibc_prototype getservbyport_r
resolv/netdb.h:316:
extern int getservbyport_r (int __port, const char *__restrict __proto,
			    struct servent *__restrict __result_buf,
			    char *__restrict __buf, size_t __buflen,
			    struct servent **__restrict __result);
.../glibc$

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-03-06 00:50:45 +01:00 committed by Michael Kerrisk
parent 4dfd2b4f70
commit 956e8829b5
1 changed files with 13 additions and 8 deletions

View File

@ -31,14 +31,19 @@ service entry (reentrant)
.nf
.B #include <netdb.h>
.PP
.BI "int getservent_r(struct servent *" result_buf ", char *" buf ,
.BI " size_t " buflen ", struct servent **" result );
.BI "int getservbyname_r(const char *" name ", const char *" proto ,
.BI " struct servent *" result_buf ", char *" buf ,
.BI " size_t " buflen ", struct servent **" result );
.BI "int getservbyport_r(int " port ", const char *" proto ,
.BI " struct servent *" result_buf ", char *" buf ,
.BI " size_t " buflen ", struct servent **" result );
.BI "int getservent_r(struct servent *restrict " result_buf ,
.BI " char *restrict " buf ", size_t " buflen ,
.BI " struct servent **restrict " result );
.BI "int getservbyname_r(const char *restrict " name ,
.BI " const char *restrict " proto ,
.BI " struct servent *restrict " result_buf ,
.BI " char *restrict " buf ", size_t " buflen ,
.BI " struct servent **restrict " result );
.BI "int getservbyport_r(int " port ,
.BI " const char *restrict " proto ,
.BI " struct servent *restrict " result_buf ,
.BI " char *restrict " buf ", size_t " buflen ,
.BI " struct servent **restrict " result );
.PP
.fi
.RS -4