diff mbox series

[01/22] getservent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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

Commit Message

Alejandro Colomar March 5, 2021, 11:50 p.m. UTC
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>
---
 man3/getservent_r.3 | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/man3/getservent_r.3 b/man3/getservent_r.3
index ad7fd22e4..c73a93afc 100644
--- a/man3/getservent_r.3
+++ b/man3/getservent_r.3
@@ -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