diff options
| author | Keith Randall <khr@golang.org> | 2015-03-02 20:16:48 -0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2015-03-03 17:46:36 +0000 |
| commit | f584c05fcc38fef1582681a7e2841b725f0a827d (patch) | |
| tree | 5a96b88327f816c5e32b57090382df4b10793153 /src/runtime/sys_linux_arm.s | |
| parent | 74e88dfdeebef392d52d3f792e2071b058c1e231 (diff) | |
| download | go-f584c05fcc38fef1582681a7e2841b725f0a827d.tar.xz | |
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_linux_arm.s')
| -rw-r--r-- | src/runtime/sys_linux_arm.s | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index 844a02a297..fa07ef88d6 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -57,6 +57,9 @@ TEXT runtime·open(SB),NOSPLIT,$0 MOVW perm+8(FP), R2 MOVW $SYS_open, R7 SWI $0 + MOVW $0xfffff001, R1 + CMP R1, R0 + MOVW.HI $-1, R0 MOVW R0, ret+12(FP) RET @@ -64,6 +67,9 @@ TEXT runtime·close(SB),NOSPLIT,$0 MOVW fd+0(FP), R0 MOVW $SYS_close, R7 SWI $0 + MOVW $0xfffff001, R1 + CMP R1, R0 + MOVW.HI $-1, R0 MOVW R0, ret+4(FP) RET @@ -73,6 +79,9 @@ TEXT runtime·write(SB),NOSPLIT,$0 MOVW n+8(FP), R2 MOVW $SYS_write, R7 SWI $0 + MOVW $0xfffff001, R1 + CMP R1, R0 + MOVW.HI $-1, R0 MOVW R0, ret+12(FP) RET @@ -82,6 +91,9 @@ TEXT runtime·read(SB),NOSPLIT,$0 MOVW n+8(FP), R2 MOVW $SYS_read, R7 SWI $0 + MOVW $0xfffff001, R1 + CMP R1, R0 + MOVW.HI $-1, R0 MOVW R0, ret+12(FP) RET |
