diff mbox series

[11/14] getnetent_r.3: SYNOPSIS: Use 'restrict' in prototypes

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

Commit Message

Alejandro Colomar \(man-pages\) Feb. 28, 2021, 12:48 a.m. UTC
glibc uses 'restrict' in getnetent_r(), getnetbyname_r(),
getnetbyaddr_r().
Let's use it here too.

.../glibc$ grep_glibc_prototype getnetent_r
resolv/netdb.h:235:
extern int getnetent_r (struct netent *__restrict __result_buf,
			char *__restrict __buf, size_t __buflen,
			struct netent **__restrict __result,
			int *__restrict __h_errnop);
.../glibc$ grep_glibc_prototype getnetbyname_r
resolv/netdb.h:246:
extern int getnetbyname_r (const char *__restrict __name,
			   struct netent *__restrict __result_buf,
			   char *__restrict __buf, size_t __buflen,
			   struct netent **__restrict __result,
			   int *__restrict __h_errnop);
.../glibc$ grep_glibc_prototype getnetbyaddr_r
resolv/netdb.h:240:
extern int getnetbyaddr_r (uint32_t __net, int __type,
			   struct netent *__restrict __result_buf,
			   char *__restrict __buf, size_t __buflen,
			   struct netent **__restrict __result,
			   int *__restrict __h_errnop);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/getnetent_r.3 | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/man3/getnetent_r.3 b/man3/getnetent_r.3
index 679391cd0..b94a67ba5 100644
--- a/man3/getnetent_r.3
+++ b/man3/getnetent_r.3
@@ -31,17 +31,20 @@  network entry (reentrant)
 .nf
 .B #include <netdb.h>
 .PP
-.BI "int getnetent_r(struct netent *" result_buf ", char *" buf ,
-.BI "                size_t " buflen ", struct netent **" result ,
-.BI "                int *" h_errnop );
-.BI "int getnetbyname_r(const char *" name ,
-.BI "                struct netent *" result_buf ", char *" buf ,
-.BI "                size_t " buflen ", struct netent **" result ,
-.BI "                int *" h_errnop );
+.BI "int getnetent_r(struct netent *restrict " result_buf ,
+.BI "                char *restrict " buf ", size_t " buflen ,
+.BI "                struct netent **restrict " result ,
+.BI "                int *restrict " h_errnop );
+.BI "int getnetbyname_r(const char *restrict " name ,
+.BI "                struct netent *restrict " result_buf ,
+.BI "                char *restrict " buf ", size_t " buflen ,
+.BI "                struct netent **restrict " result ,
+.BI "                int *restrict " h_errnop );
 .BI "int getnetbyaddr_r(uint32_t " net ", int " type ,
-.BI "                struct netent *" result_buf ", char *" buf ,
-.BI "                size_t " buflen ", struct netent **" result ,
-.BI "                int *" h_errnop );
+.BI "                struct netent *restrict " result_buf ,
+.BI "                char *restrict " buf ", size_t " buflen ,
+.BI "                struct netent **restrict " result ,
+.BI "                int *restrict " h_errnop );
 .PP
 .fi
 .RS -4