diff options
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/sys/socket.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibC/sys/socket.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/sys/socket.cpp b/Userland/Libraries/LibC/sys/socket.cpp index 96211141b1..ba9cdd38ec 100644 --- a/Userland/Libraries/LibC/sys/socket.cpp +++ b/Userland/Libraries/LibC/sys/socket.cpp @@ -34,7 +34,13 @@ int listen(int sockfd, int backlog) int accept(int sockfd, sockaddr* addr, socklen_t* addrlen) { - int rc = syscall(SC_accept, sockfd, addr, addrlen); + return accept4(sockfd, addr, addrlen, 0); +} + +int accept4(int sockfd, sockaddr* addr, socklen_t* addrlen, int flags) +{ + Syscall::SC_accept4_params params { sockfd, addr, addrlen, flags }; + int rc = syscall(SC_accept4, ¶ms); __RETURN_WITH_ERRNO(rc, rc, -1); } diff --git a/Userland/Libraries/LibC/sys/socket.h b/Userland/Libraries/LibC/sys/socket.h index 44b673546d..0ff9aaff14 100644 --- a/Userland/Libraries/LibC/sys/socket.h +++ b/Userland/Libraries/LibC/sys/socket.h @@ -127,6 +127,7 @@ int socket(int domain, int type, int protocol); int bind(int sockfd, const struct sockaddr* addr, socklen_t); int listen(int sockfd, int backlog); int accept(int sockfd, struct sockaddr*, socklen_t*); +int accept4(int sockfd, struct sockaddr*, socklen_t*, int); int connect(int sockfd, const struct sockaddr*, socklen_t); int shutdown(int sockfd, int how); ssize_t send(int sockfd, const void*, size_t, int flags); |