aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_amd64.s
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2015-03-02 20:16:48 -0800
committerKeith Randall <khr@golang.org>2015-03-03 17:46:36 +0000
commitf584c05fcc38fef1582681a7e2841b725f0a827d (patch)
tree5a96b88327f816c5e32b57090382df4b10793153 /src/runtime/sys_netbsd_amd64.s
parent74e88dfdeebef392d52d3f792e2071b058c1e231 (diff)
downloadgo-f584c05fcc38fef1582681a7e2841b725f0a827d.tar.gz
go-f584c05fcc38fef1582681a7e2841b725f0a827d.zip
runtime: Update open/close/read/write to return -1 on error.
Error detection code copied from syscall, where presumably we actually do it right. Note that we throw the errno away. The runtime doesn't use it. Fixes #10052 Change-Id: I8de77dda6bf287276b137646c26b84fa61554ec8 Reviewed-on: https://go-review.googlesource.com/6571 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/sys_netbsd_amd64.s')
-rw-r--r--src/runtime/sys_netbsd_amd64.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/sys_netbsd_amd64.s b/src/runtime/sys_netbsd_amd64.s
index 83de9111dd..88ca323aaf 100644
--- a/src/runtime/sys_netbsd_amd64.s
+++ b/src/runtime/sys_netbsd_amd64.s
@@ -91,6 +91,8 @@ TEXT runtime·open(SB),NOSPLIT,$-8
MOVL perm+12(FP), DX // arg 3 mode
MOVL $5, AX
SYSCALL
+ JCC 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+16(FP)
RET
@@ -98,6 +100,8 @@ TEXT runtime·close(SB),NOSPLIT,$-8
MOVL fd+0(FP), DI // arg 1 fd
MOVL $6, AX
SYSCALL
+ JCC 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+8(FP)
RET
@@ -107,6 +111,8 @@ TEXT runtime·read(SB),NOSPLIT,$-8
MOVL n+16(FP), DX // arg 3 count
MOVL $3, AX
SYSCALL
+ JCC 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+24(FP)
RET
@@ -116,6 +122,8 @@ TEXT runtime·write(SB),NOSPLIT,$-8
MOVL n+16(FP), DX // arg 3 - nbyte
MOVL $4, AX // sys_write
SYSCALL
+ JCC 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+24(FP)
RET