accept.2: SYNOPSIS: Use 'restrict' in prototypes

POSIX specifies the parameters of accept() shall be 'restrict'.
Glibc uses 'restrict' too (also for accept4()).
Let's use it here too.

......

.../glibc$ grep_glibc_prototype accept
socket/sys/socket.h:232:
extern int accept (int __fd, __SOCKADDR_ARG __addr,
		   socklen_t *__restrict __addr_len);
.../glibc$ grep_glibc_prototype accept4
socket/sys/socket.h:240:
extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
		    socklen_t *__restrict __addr_len, int __flags);
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-02-14 00:10:11 +01:00 committed by Michael Kerrisk
parent bb5d2db62e
commit e234eef0c6
1 changed files with 4 additions and 3 deletions

View File

@ -46,13 +46,14 @@ accept, accept4 \- accept a connection on a socket
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h>
.PP
.BI "int accept(int " sockfd ", struct sockaddr *" addr ", socklen_t *" addrlen );
.BI "int accept(int " sockfd ", struct sockaddr *restrict " addr ,
.BI " socklen_t *restrict " addrlen );
.PP
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/socket.h>
.PP
.BI "int accept4(int " sockfd ", struct sockaddr *" addr ,
.BI " socklen_t *" addrlen ", int " flags );
.BI "int accept4(int " sockfd ", struct sockaddr *restrict " addr ,
.BI " socklen_t *restrict " addrlen ", int " flags );
.fi
.SH DESCRIPTION
The