aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_freebsd_amd64.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/sys_freebsd_amd64.s')
-rw-r--r--src/runtime/sys_freebsd_amd64.s10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/runtime/sys_freebsd_amd64.s b/src/runtime/sys_freebsd_amd64.s
index 55e7e250ae..d769577ed4 100644
--- a/src/runtime/sys_freebsd_amd64.s
+++ b/src/runtime/sys_freebsd_amd64.s
@@ -483,16 +483,20 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
MOVL AX, ret+48(FP)
RET
-// func fcntl(fd, cmd, arg int32) int32
+// func fcntl(fd, cmd, arg int32) (int32, int32)
TEXT runtime·fcntl(SB),NOSPLIT,$0
MOVL fd+0(FP), DI // fd
MOVL cmd+4(FP), SI // cmd
MOVL arg+8(FP), DX // arg
MOVL $92, AX
SYSCALL
- JCC 2(PC)
- NEGQ AX // caller expects negative errno
+ JCC noerr
+ MOVL $-1, ret+16(FP)
+ MOVL AX, errno+20(FP)
+ RET
+noerr:
MOVL AX, ret+16(FP)
+ MOVL $0, errno+20(FP)
RET
// void runtime·closeonexec(int32 fd);