netbsd: NetBSD ships with paccept(2) a superset of Linux-specific accept4()

[diwic: Moved paccept to #bsd line in configure.ac]
This commit is contained in:
Kamil Rytarowski 2015-11-21 23:08:23 +01:00 committed by David Henningsson
parent 30a9523b75
commit 3753f50755
2 changed files with 8 additions and 1 deletions

View file

@ -3501,6 +3501,8 @@ finish:
int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
int fd;
errno = 0;
#ifdef HAVE_ACCEPT4
if ((fd = accept4(sockfd, addr, addrlen, SOCK_CLOEXEC)) >= 0)
goto finish;
@ -3510,6 +3512,11 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
#endif
#ifdef HAVE_PACCEPT
if ((fd = paccept(sockfd, addr, addrlen, NULL, SOCK_CLOEXEC)) >= 0)
goto finish;
#endif
if ((fd = accept(sockfd, addr, addrlen)) >= 0)
goto finish;