NuttX: use accept4 (#21544)

NuttX supports accept4 since 48c9d10336
This commit is contained in:
Hiroki Noda
2023-03-21 02:41:25 +09:00
committed by GitHub
parent cae539996a
commit 0c1d595fae
2 changed files with 2 additions and 2 deletions

View File

@@ -958,7 +958,7 @@ proc `==`*(x, y: SocketHandle): bool {.borrow.}
proc accept*(a1: SocketHandle, a2: ptr SockAddr, a3: ptr SockLen): SocketHandle {.
importc, header: "<sys/socket.h>", sideEffect.}
when defined(linux) or defined(bsd):
when defined(linux) or defined(bsd) or defined(nuttx):
proc accept4*(a1: SocketHandle, a2: ptr SockAddr, a3: ptr SockLen,
flags: cint): SocketHandle {.importc, header: "<sys/socket.h>".}

View File

@@ -646,7 +646,7 @@ elif defined(nuttx):
else:
var SO_REUSEPORT* {.importc, header: "<sys/socket.h>".}: cint
when defined(linux) or defined(bsd):
when defined(linux) or defined(bsd) or defined(nuttx):
var SOCK_CLOEXEC* {.importc, header: "<sys/socket.h>".}: cint
when defined(macosx):