Commit e38c213e authored by Max Kellermann's avatar Max Kellermann

net/SocketDescriptor: check HAVE_ACCEPT4

parent 699f41e1
...@@ -58,7 +58,7 @@ SocketDescriptor::Close() ...@@ -58,7 +58,7 @@ SocketDescriptor::Close()
SocketDescriptor SocketDescriptor
SocketDescriptor::Accept() SocketDescriptor::Accept()
{ {
#if defined(__linux__) && !defined(__BIONIC__) && !defined(KOBO) #ifdef HAVE_ACCEPT4
int connection_fd = ::accept4(Get(), nullptr, nullptr, SOCK_CLOEXEC); int connection_fd = ::accept4(Get(), nullptr, nullptr, SOCK_CLOEXEC);
#else #else
int connection_fd = ::accept(Get(), nullptr, nullptr); int connection_fd = ::accept(Get(), nullptr, nullptr);
...@@ -72,7 +72,7 @@ SocketDescriptor ...@@ -72,7 +72,7 @@ SocketDescriptor
SocketDescriptor::AcceptNonBlock(StaticSocketAddress &address) const SocketDescriptor::AcceptNonBlock(StaticSocketAddress &address) const
{ {
address.SetMaxSize(); address.SetMaxSize();
#if defined(__linux__) && !defined(__BIONIC__) && !defined(KOBO) #ifdef HAVE_ACCEPT4
int connection_fd = ::accept4(Get(), address, &address.size, int connection_fd = ::accept4(Get(), address, &address.size,
SOCK_CLOEXEC|SOCK_NONBLOCK); SOCK_CLOEXEC|SOCK_NONBLOCK);
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment