aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_openbsd_amd64.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_amd64.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_amd64.s')
-rw-r--r--src/runtime/sys_openbsd_amd64.s7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runtime/sys_openbsd_amd64.s b/src/runtime/sys_openbsd_amd64.s
index fc89ee6cbb..fc6d5dc387 100644
--- a/src/runtime/sys_openbsd_amd64.s
+++ b/src/runtime/sys_openbsd_amd64.s
@@ -369,8 +369,11 @@ TEXT runtime·clock_gettime_trampoline(SB),NOSPLIT,$0
MOVL 0(DI), DI // arg 1 clock_id
CALL libc_clock_gettime(SB)
TESTL AX, AX
- JEQ 2(PC)
- MOVL $0xf1, 0xf1 // crash
+ JEQ noerr
+ CALL libc_errno(SB)
+ MOVL (AX), AX // errno
+ NEGL AX // caller expects negative errno value
+noerr:
POPQ BP
RET