diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-02-28 01:48:11 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2021-03-03 23:24:23 +0100 |
| commit | 938c8215eb9a6076bb4c930d6be388d6ab3da3fb (patch) | |
| tree | 31a7675882814566c9a2f6d063a7fbaee3a98501 /man3 | |
| parent | 2bebee6f606d610ad9854a0e2a2505ea5473a14b (diff) | |
| download | man-pages-938c8215eb9a6076bb4c930d6be388d6ab3da3fb.tar.gz | |
gethostbyname.3: SYNOPSIS: Use 'restrict' in prototypes
glibc uses 'restrict' in gethostent_r(), gethostbyaddr_r(),
gethostbyname_r(), gethostbyname2_r().
Let's use it here too.
.../glibc$ grep_glibc_prototype gethostent_r
resolv/netdb.h:165:
extern int gethostent_r (struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop);
.../glibc$ grep_glibc_prototype gethostbyaddr_r
resolv/netdb.h:170:
extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len,
int __type,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop);
.../glibc$ grep_glibc_prototype gethostbyname_r
resolv/netdb.h:177:
extern int gethostbyname_r (const char *__restrict __name,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop);
.../glibc$ grep_glibc_prototype gethostbyname2_r
resolv/netdb.h:183:
extern int gethostbyname2_r (const char *__restrict __name, int __af,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop);
.../glibc$
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/gethostbyname.3 | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/man3/gethostbyname.3 b/man3/gethostbyname.3 index ac1758ca0b..d2c4560724 100644 --- a/man3/gethostbyname.3 +++ b/man3/gethostbyname.3 @@ -65,18 +65,27 @@ gethostent_r \- get network host entry /* GNU extensions */ .BI "struct hostent *gethostbyname2(const char *" name ", int " af ); .PP -.BI "int gethostent_r(struct hostent *" ret ", char *" buf ", size_t " buflen , -.BI " struct hostent **" result ", int *" h_errnop ); +.BI "int gethostent_r(struct hostent *restrict " ret , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct hostent **restrict " result , +.BI " int *restrict " h_errnop ); .PP -.BI "int gethostbyaddr_r(const void *" addr ", socklen_t " len ", int " type , -.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , -.BI " struct hostent **" result ", int *" h_errnop ); -.BI "int gethostbyname_r(const char *" name , -.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , -.BI " struct hostent **" result ", int *" h_errnop ); -.BI "int gethostbyname2_r(const char *" name ", int " af, -.BI " struct hostent *" ret ", char *" buf ", size_t " buflen , -.BI " struct hostent **" result ", int *" h_errnop ); +.BI "int gethostbyaddr_r(const void *restrict " addr ", socklen_t " len \ +", int " type , +.BI " struct hostent *restrict " ret , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct hostent **restrict " result , +.BI " int *restrict " h_errnop ); +.BI "int gethostbyname_r(const char *restrict " name , +.BI " struct hostent *restrict " ret , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct hostent **restrict " result , +.BI " int *restrict " h_errnop ); +.BI "int gethostbyname2_r(const char *restrict " name ", int " af, +.BI " struct hostent *restrict " ret , +.BI " char *restrict " buf ", size_t " buflen , +.BI " struct hostent **restrict " result , +.BI " int *restrict " h_errnop ); .fi .PP .RS -4 |
