]> Cypherpunks repositories - gostls13.git/commit
runtime: call miniterrno on m0 on AIX and Solaris
authorIan Lance Taylor <iant@golang.org>
Wed, 26 Jul 2023 18:58:44 +0000 (11:58 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 27 Jul 2023 22:20:25 +0000 (22:20 +0000)
commit737a5b0eaaff9098a41c04bcee5585678766bfae
treec489667ca6343bd156894c1acc0452d5777fca8d
parent9b0361e549949a208aa6bbcdff25506a3f97d7a9
runtime: call miniterrno on m0 on AIX and Solaris

AIX and Solaris call into libc for syscalls, and expect M.mOS.perrno
to point to the thread-local errno value for the current M.
We initialize that field in miniterrno called from mstart.
However, this means that any libc calls before mstart will not
return the correct errno value.

This caused trouble in checkfds, which runs very early, before mstart.
We worked around that in 513215. This CL reverts 513215 in favor
of a better workaround: call miniterrno for m0 earlier (we will
still wind up calling miniterrno again from mstart, which does
no harm).

This is a better workaround because it means that if we add future
syscalls before mstart, they will behave as expected.

Fixes #61584

Change-Id: Ib6a0d3c53d2c8214cc339a5019f9d4f71a746f0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/513535
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
src/runtime/fds_unix.go
src/runtime/os3_solaris.go
src/runtime/os_aix.go