From 12de6a36d46bf82202d069c13d0a2555ebd96aa7 Mon Sep 17 00:00:00 2001 From: Drahflow Date: Mon, 20 Mar 2017 19:41:58 +0100 Subject: Correctly set errno --- elymas/lib/sys/linux.ey | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/elymas/lib/sys/linux.ey b/elymas/lib/sys/linux.ey index b733a27..89958ac 100644 --- a/elymas/lib/sys/linux.ey +++ b/elymas/lib/sys/linux.ey @@ -308,6 +308,8 @@ 20 ==:WRITEV # TODO: not implemented here 0 ==errno + + 11 _ ==:EAGAIN ==:EWOULDBLOCK bin .scan "->" via bin .print "<-" via @@ -316,7 +318,7 @@ # to kernel API and returns the raw return value { # ==name ==f -01 - { sys .asm .syscall =errno } ; + { sys .asm .syscall -- _ 0 ge { 0 =errno } { neg =errno 1 neg } ? * } ; -01 deffd }' /defStdSyscall deff @@ -346,6 +348,13 @@ { 0 0 0 0 0 0 FORK } /fork defStdSyscall + 1 ==:FGETFD + 2 ==:FSETFD + 3 ==:FGETFL + 4 ==:FSETFL + + { 0 0 0 FCNTL } /fcntl defStdSyscall + { 0 0 0 0 0 0 GETPID } /getpid defStdSyscall # 0 -> open directory file descriptor -- cgit v1.2.3