mirror of
https://github.com/golang/go
synced 2024-09-30 18:18:32 -06:00
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>
This commit is contained in:
parent
a76099f0d9
commit
3a56aa0d3e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user