From e2cfcc8e4b59de8334da380dabf9d5208c5e7f4c Mon Sep 17 00:00:00 2001 From: Drahflow Date: Sun, 28 Dec 2014 16:32:47 +0100 Subject: Supply SO_REUSEADDR (default for buffered servers) --- elymas/lib/sys/linux.ey | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'elymas/lib/sys/linux.ey') 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 -- cgit v1.2.3