aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_386.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/sys_netbsd_386.s')
-rw-r--r--src/runtime/sys_netbsd_386.s10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/runtime/sys_netbsd_386.s b/src/runtime/sys_netbsd_386.s
index a05e1d4478..e649fb13cb 100644
--- a/src/runtime/sys_netbsd_386.s
+++ b/src/runtime/sys_netbsd_386.s
@@ -457,13 +457,17 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
MOVL AX, ret+24(FP)
RET
-// func fcntl(fd, cmd, arg int32) int32
+// func fcntl(fd, cmd, arg int32) (int32, int32)
TEXT runtime·fcntl(SB),NOSPLIT,$-4
MOVL $SYS_fcntl, AX
INT $0x80
- JAE 2(PC)
- NEGL AX // caller expects negative errno
+ JAE noerr
+ MOVL $-1, ret+12(FP)
+ MOVL AX, errno+16(FP)
+ RET
+noerr:
MOVL AX, ret+12(FP)
+ MOVL $0, errno+16(FP)
RET
// int32 runtime·closeonexec(int32 fd)