aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_openbsd_386.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2021-12-01 13:41:45 -0500
committerAustin Clements <austin@google.com>2021-12-02 15:48:58 +0000
commit28ec0fdeb500b4d0ab5c0ac07cba2f5ebc12ae32 (patch)
tree1467272f787a3a04d6a34ebc358e05748d05bc17 /src/runtime/sys_openbsd_386.s
parentd34051bf16d86a88e6c5764aa076219069702045 (diff)
downloadgo-28ec0fdeb500b4d0ab5c0ac07cba2f5ebc12ae32.tar.xz
runtime: print errno on clock_gettime failure on OpenBSD
For #49532. Change-Id: I5afc64c987f0519903128550a7dac3a0f5e592cf Reviewed-on: https://go-review.googlesource.com/c/go/+/368334 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_openbsd_386.s')
-rw-r--r--src/runtime/sys_openbsd_386.s7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runtime/sys_openbsd_386.s b/src/runtime/sys_openbsd_386.s
index 7830b61b7d..890b96b673 100644
--- a/src/runtime/sys_openbsd_386.s
+++ b/src/runtime/sys_openbsd_386.s
@@ -520,8 +520,11 @@ TEXT runtime·clock_gettime_trampoline(SB),NOSPLIT,$0
MOVL BX, 4(SP) // arg 2 - clock_id
CALL libc_clock_gettime(SB)
CMPL AX, $-1
- JNE 2(PC)
- MOVL $0xf1, 0xf1 // crash on failure
+ JNE noerr
+ CALL libc_errno(SB)
+ MOVL (AX), AX
+ NEGL AX // caller expects negative errno
+noerr:
MOVL BP, SP
POPL BP
RET