summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorHiroki Noda <kubo39@gmail.com>2023-03-21 02:41:25 +0900
committerGitHub <noreply@github.com>2023-03-20 18:41:25 +0100
commit0c1d595fae32b41085177ee8bd95b7845c7db68c (patch)
tree51b64e566e23f51e8d3231a41ffb71368f97636f
parentcae539996a9a3b4c79af06d9ba8a0f9273bab3e1 (diff)
downloadNim-0c1d595fae32b41085177ee8bd95b7845c7db68c.tar.gz
NuttX: use accept4 (#21544)
NuttX supports accept4 since https://github.com/apache/nuttx/commit/48c9d1033659603663f6e35587cf27045a130e0d
-rw-r--r--lib/posix/posix.nim2
-rw-r--r--lib/posix/posix_other.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 12fc8fd57..fbe945df3 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -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>".}
 
diff --git a/lib/posix/posix_other.nim b/lib/posix/posix_other.nim
index 1b6734b51..d5e3c782e 100644
--- a/lib/posix/posix_other.nim
+++ b/lib/posix/posix_other.nim
@@ -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):