diff mbox series

[10/14] getnameinfo.3: SYNOPSIS: Use 'restrict' in prototypes

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

Commit Message

Alejandro Colomar Feb. 28, 2021, 12:48 a.m. UTC
Both POSIX and glibc use 'restrict' in getnameinfo().
Let's use it here too.

I conciously did an exception with respect to the right margin
of the rendered page.  Instead of having the right margin at 78
as usual (per Branden's recommendation), I let it use col 79
this time, to avoid breaking the prototype in an ugly way.

.../glibc$ grep_glibc_prototype getnameinfo
resolv/netdb.h:675:
extern int getnameinfo (const struct sockaddr *__restrict __sa,
			socklen_t __salen, char *__restrict __host,
			socklen_t __hostlen, char *__restrict __serv,
			socklen_t __servlen, int __flags);
.../glibc$

Cc: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/getnameinfo.3 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/man3/getnameinfo.3 b/man3/getnameinfo.3
index eff8b2562..d4d3f42e5 100644
--- a/man3/getnameinfo.3
+++ b/man3/getnameinfo.3
@@ -15,9 +15,11 @@  getnameinfo \- address-to-name translation in protocol-independent manner
 .B #include <sys/socket.h>
 .B #include <netdb.h>
 .PP
-.BI "int getnameinfo(const struct sockaddr *" "addr" ", socklen_t " "addrlen" ,
-.BI "                char *" "host" ", socklen_t " "hostlen" ,
-.BI "                char *" "serv" ", socklen_t " "servlen" ", int " "flags" );
+.BI "int getnameinfo(const struct sockaddr *restrict " addr \
+", socklen_t " addrlen ,
+.BI "                char *restrict " host ", socklen_t " hostlen ,
+.BI "                char *restrict " serv ", socklen_t " servlen \
+", int " flags );
 .fi
 .PP
 .RS -4