summaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_arm.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-05-15 16:34:36 -0700
committerGopher Robot <gobot@golang.org>2023-05-17 04:58:07 +0000
commit547aed18e0db6a18c207731d56b60a24d0c69ba5 (patch)
treeae27d32ac15d0466e9a8829eb23a28a6bf1a3a38 /src/runtime/sys_netbsd_arm.s
parent6d1c507bfc360ba72ca716bb7cb7bd9105a45af4 (diff)
downloadgo-git-547aed18e0db6a18c207731d56b60a24d0c69ba5.tar.gz
runtime: consistently define fcntl
Clean up and consolidate on a single consistent definition of fcntl, which takes three int32 arguments and returns either a positive result or a negative errno value. Change-Id: Id9505492712db4b0aab469c6bd15e4fce3c9ff6e Reviewed-on: https://go-review.googlesource.com/c/go/+/495075 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/sys_netbsd_arm.s')
-rw-r--r--src/runtime/sys_netbsd_arm.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/sys_netbsd_arm.s b/src/runtime/sys_netbsd_arm.s
index 62fa852add..f9cbcb6df1 100644
--- a/src/runtime/sys_netbsd_arm.s
+++ b/src/runtime/sys_netbsd_arm.s
@@ -398,6 +398,16 @@ TEXT runtime·kevent(SB),NOSPLIT,$8
MOVW R0, ret+24(FP)
RET
+// func fcntl(fd, cmd, args int32) int32
+TEXT runtime·fcntl(SB),NOSPLIT,$0
+ MOVW fd+0(FP), R0
+ MOVW cmd+4(FP), R1
+ MOVW arg+8(FP), R2
+ SWI $SYS_fcntl
+ RSB.CS $0, R0 // caller expects negative errno
+ MOVW R0, ret+12(FP)
+ RET
+
// void runtime·closeonexec(int32 fd)
TEXT runtime·closeonexec(SB),NOSPLIT,$0
MOVW fd+0(FP), R0 // fd