]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: correct error handling in several FreeBSD syscall wrappers
authorNikhil Benesch <nikhil.benesch@gmail.com>
Wed, 9 Dec 2020 20:14:59 +0000 (15:14 -0500)
committerAustin Clements <austin@google.com>
Tue, 22 Dec 2020 15:59:17 +0000 (15:59 +0000)
commit4d27c4c223ccb7de3876abbac79b58ad9579be1a
treef1b8cc8a73f86e689615d13f934659a20eec319f
parent9b6147120a30a8bc30a41c1651f369e8bcb80948
runtime: correct error handling in several FreeBSD syscall wrappers

The FreeBSD syscall convention uses the carry flag to indicate whether
an error has occured. The sys_umtx_op, thr_new, and pipe2 syscall
wrappers were failing to account for this convention and silently
suppressing errors as a result. This commit corrects these wrappers
by copying the pattern used by the other fallible syscall wrappers.

Note that futexsleep1 must now explicitly ignore the ETIMEDOUT error
from sys_umtx_op. Previously ETIMEDOUT was implicitly ignored because
sys_umtx_op never returned an error.

Fixes #43106.

Change-Id: I9c422b87cf4c6d308003bf42c3b419f785578b5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/276892
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Than McIntosh <thanm@google.com>
src/runtime/defs_freebsd_386.go
src/runtime/defs_freebsd_amd64.go
src/runtime/defs_freebsd_arm.go
src/runtime/defs_freebsd_arm64.go
src/runtime/os_freebsd.go
src/runtime/sys_freebsd_386.s
src/runtime/sys_freebsd_amd64.s
src/runtime/sys_freebsd_arm.s
src/runtime/sys_freebsd_arm64.s