[PATCH 17/23] rcmd.3: SYNOPSIS: Use 'restrict' in prototypes
Alejandro Colomar
alx.manpages@gmail.com
Mon Mar 8 18:53:26 GMT 2021
glibc uses 'restrict' in rcmd(), rcmd_af(), iruserok_af().
Let's use it here too.
.../glibc$ grep_glibc_prototype rcmd
resolv/netdb.h:449:
extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
const char *__restrict __locuser,
const char *__restrict __remuser,
const char *__restrict __cmd, int *__restrict __fd2p);
.../glibc$ grep_glibc_prototype rcmd_af
resolv/netdb.h:461:
extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
const char *__restrict __locuser,
const char *__restrict __remuser,
const char *__restrict __cmd, int *__restrict __fd2p,
sa_family_t __af);
.../glibc$ grep_glibc_prototype iruserok_af
resolv/netdb.h:537:
extern int iruserok_af (const void *__raddr, int __suser,
const char *__remuser, const char *__locuser,
sa_family_t __af);
.../glibc$
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/rcmd.3 | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/man3/rcmd.3 b/man3/rcmd.3
index 0349646c7..d2df6b629 100644
--- a/man3/rcmd.3
+++ b/man3/rcmd.3
@@ -49,28 +49,30 @@ stream to a remote command
.nf
.BR "#include <netdb.h> " "/* Or <unistd.h> on some systems */"
.PP
-.BI "int rcmd(char **" ahost ", unsigned short " inport ", const char *" locuser ,
-.BI " const char *" remuser ", const char *" cmd ", int *" fd2p );
+.BI "int rcmd(char **restrict " ahost ", unsigned short " inport ,
+.BI " const char *restrict " locuser ", const char *restrict " remuser ,
+.BI " const char *restrict " cmd ", int *restrict " fd2p );
.PP
.BI "int rresvport(int *" port );
.PP
.BI "int iruserok(uint32_t " raddr ", int " superuser ,
-.BI " const char *" ruser ", const char *" luser );
+.BI " const char *" ruser ", const char *" luser );
.BI "int ruserok(const char *" rhost ", int " superuser ,
-.BI " const char *" ruser ", const char *" luser );
+.BI " const char *" ruser ", const char *" luser );
.PP
-.BI "int rcmd_af(char **" ahost ", unsigned short " inport ", const char *" locuser ,
-.BI " const char *" remuser ", const char *" cmd ", int *" fd2p ,
-.BI " sa_family_t " af );
+.BI "int rcmd_af(char **restrict " ahost ", unsigned short " inport ,
+.BI " const char *restrict " locuser ", const char *restrict " remuser ,
+.BI " const char *restrict " cmd ", int *restrict " fd2p ,
+.BI " sa_family_t " af );
.PP
.BI "int rresvport_af(int *" port ", sa_family_t " af );
.PP
-.BI "int iruserok_af(const void *" raddr ", int " superuser ,
-.BI " const char *" ruser ", const char *" luser \
-", sa_family_t " af );
+.BI "int iruserok_af(const void *restrict " raddr ", int " superuser ,
+.BI " const char *restrict " ruser ", const char *restrict " luser ,
+.BI " sa_family_t " af );
.BI "int ruserok_af(const char *" rhost ", int " superuser ,
-.BI " const char *" ruser ", const char *" luser \
-", sa_family_t " af );
+.BI " const char *" ruser ", const char *" luser ,
+.BI " sa_family_t " af );
.fi
.PP
.RS -4
--
2.30.1
More information about the Libc-alpha
mailing list