aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib/sys
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2014-12-28 16:32:47 +0100
committerDrahflow <drahflow@gmx.de>2014-12-28 16:32:47 +0100
commite2cfcc8e4b59de8334da380dabf9d5208c5e7f4c (patch)
tree3f872919f20fe2e06089696e089ac3d3fe8dc479 /elymas/lib/sys
parent0e816c4c2c6f4df7f568b1ba0506354e8a83051c (diff)
Supply SO_REUSEADDR (default for buffered servers)
Diffstat (limited to 'elymas/lib/sys')
-rw-r--r--elymas/lib/sys/linux.ey16
1 files changed, 15 insertions, 1 deletions
diff --git a/elymas/lib/sys/linux.ey b/elymas/lib/sys/linux.ey
index d16a483..a155d9a 100644
--- a/elymas/lib/sys/linux.ey
+++ b/elymas/lib/sys/linux.ey
@@ -245,7 +245,7 @@
# 113 ==:SETREUID
# 160 ==:SETRLIMIT
# 112 ==:SETSID
- # 54 ==:SETSOCKOPT
+ 54 ==:SETSOCKOPT
# 164 ==:SETTIMEOFDAY
# 105 ==:SETUID
# 188 ==:SETXATTR
@@ -662,6 +662,20 @@
{ 0 0 0 READ } /read defStdSyscall
+ <
+ 1 ==:SOLSOCKET
+
+ # TODO: support more options
+ 2 ==:SOREUSEADDR
+
+ # 0 -> socket fd
+ # 1 -> turn it on (1) or off (0)
+ # 0 <- raw return value
+ { ==fd ==value
+ fd SOLSOCKET SOREUSEADDR "" value <-u32 4 0 SETSOCKOPT sys .asm .syscall =errno
+ } /reuseAddr deffd
+ > /setsockopt defvd
+
# 0 <- raw return value
# 1 <- returned status
{ ==options ==pid