aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_386.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_386.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_386.s')
-rw-r--r--src/runtime/sys_netbsd_386.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/sys_netbsd_386.s b/src/runtime/sys_netbsd_386.s
index 509d6d4a85..e0fc926fb9 100644
--- a/src/runtime/sys_netbsd_386.s
+++ b/src/runtime/sys_netbsd_386.s
@@ -27,24 +27,32 @@ TEXT runtime·exit1(SB),NOSPLIT,$-4
TEXT runtime·open(SB),NOSPLIT,$-4
MOVL $5, AX
INT $0x80
+ JAE 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+12(FP)
RET
TEXT runtime·close(SB),NOSPLIT,$-4
MOVL $6, AX
INT $0x80
+ JAE 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+4(FP)
RET
TEXT runtime·read(SB),NOSPLIT,$-4
MOVL $3, AX
INT $0x80
+ JAE 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+12(FP)
RET
TEXT runtime·write(SB),NOSPLIT,$-4
MOVL $4, AX // sys_write
INT $0x80
+ JAE 2(PC)
+ MOVL $-1, AX
MOVL AX, ret+12(FP)
RET