summary refs log tree commit diff stats
path: root/lib/posix/posix_other.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/posix/posix_other.nim')
-rw-r--r--lib/posix/posix_other.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/posix/posix_other.nim b/lib/posix/posix_other.nim
index 941e13192..1b6734b51 100644
--- a/lib/posix/posix_other.nim
+++ b/lib/posix/posix_other.nim
@@ -10,7 +10,7 @@
 when defined(nimHasStyleChecks):
   {.push styleChecks: off.}
 
-when defined(freertos) or defined(zephyr):
+when defined(freertos) or defined(zephyr) or defined(nuttx):
   const
     hasSpawnH = false # should exist for every Posix system nowadays
     hasAioH = false
@@ -640,6 +640,9 @@ when defined(linux) or defined(nimdoc):
       ## or UDP packets. (Requires Linux kernel > 3.9)
   else:
     const SO_REUSEPORT* = cint(15)
+elif defined(nuttx):
+  # Not supported, use SO_REUSEADDR to avoid compilation errors.
+  var SO_REUSEPORT* {.importc: "SO_REUSEADDR", header: "<sys/socket.h>".}: cint
 else:
   var SO_REUSEPORT* {.importc, header: "<sys/socket.h>".}: cint