diff options
author | Keith Randall <khr@golang.org> | 2015-04-21 15:47:58 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2015-04-22 02:30:22 +0000 |
commit | 3a56aa0d3eb14aed7829c41df47b653a2f5c16f7 (patch) | |
tree | 2d1e56a48303f2c2c7327f744938a24dd1a81436 /src/runtime/sys_linux_arm64.s | |
parent | a76099f0d9699ee0017951a541197bdaa2c2d112 (diff) | |
download | go-3a56aa0d3eb14aed7829c41df47b653a2f5c16f7.tar.gz go-3a56aa0d3eb14aed7829c41df47b653a2f5c16f7.zip |
runtime: check error codes for arm64 system calls
Unlike linux arm32, linux arm64 does not set the condition codes to indicate
whether a system call failed or not. We must check if the return value
is in the error code range (the same as amd64 does).
Fixes runtime.TestBadOpen test.
Change-Id: I97a8b0a17b5f002a3215c535efa91d199cee3309
Reviewed-on: https://go-review.googlesource.com/9220
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_arm64.s')
-rw-r--r-- | src/runtime/sys_linux_arm64.s | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s index 32404570fe..52b34e8f41 100644 --- a/src/runtime/sys_linux_arm64.s +++ b/src/runtime/sys_linux_arm64.s @@ -72,6 +72,7 @@ TEXT runtime·closefd(SB),NOSPLIT,$-8-12 MOVW fd+0(FP), R0 MOVD $SYS_close, R8 SVC + CMN $4095, R0 BCC done MOVW $-1, R0 done: @@ -84,6 +85,7 @@ TEXT runtime·write(SB),NOSPLIT,$-8-28 MOVW n+16(FP), R2 MOVD $SYS_write, R8 SVC + CMN $4095, R0 BCC done MOVW $-1, R0 done: @@ -96,6 +98,7 @@ TEXT runtime·read(SB),NOSPLIT,$-8-28 MOVW n+16(FP), R2 MOVD $SYS_read, R8 SVC + CMN $4095, R0 BCC done MOVW $-1, R0 done: |