aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_openbsd_arm.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-04-05 11:42:37 -0700
committerIan Lance Taylor <iant@golang.org>2019-10-21 14:07:34 +0000
commitb653c878b1ad8d1b4f8d7b04201d0cb0a4156ead (patch)
tree3f4189ae0a4f5c61ae8fc0badf402d2016533289 /src/runtime/sys_openbsd_arm.s
parent6917b3c839af615e22ef479b23983d186e578bd6 (diff)
downloadgo-b653c878b1ad8d1b4f8d7b04201d0cb0a4156ead.tar.xz
runtime: change read and write to return negative errno value
The internal read and write functions used to return -1 on error; change them to return a negative errno value instead. This will be used by later CLs in this series. For most targets this is a simplification, although for ones that call into libc it is a complication. Updates #27707 Change-Id: Id02bf9487f03e7e88e4f2b85e899e986738697ad Reviewed-on: https://go-review.googlesource.com/c/go/+/171823 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/sys_openbsd_arm.s')
-rw-r--r--src/runtime/sys_openbsd_arm.s4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/sys_openbsd_arm.s b/src/runtime/sys_openbsd_arm.s
index 16de1efd03..3736451ba2 100644
--- a/src/runtime/sys_openbsd_arm.s
+++ b/src/runtime/sys_openbsd_arm.s
@@ -55,7 +55,7 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 - nbyte
MOVW $3, R12 // sys_read
SWI $0
- MOVW.CS $-1, R0
+ SUB.CS $0, R0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET
@@ -82,7 +82,7 @@ TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 - nbyte
MOVW $4, R12 // sys_write
SWI $0
- MOVW.CS $-1, R0
+ SUB.CS $0, R0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET