]> Cypherpunks repositories - gostls13.git/commit
runtime: use futexes with 64-bit time on Linux
authorDaniel Maslowski <info@orangecms.org>
Thu, 18 Sep 2025 15:43:42 +0000 (15:43 +0000)
committerJorropo <jorropo.pgm@gmail.com>
Fri, 19 Sep 2025 04:04:12 +0000 (21:04 -0700)
commit3cf1aaf8b9c846c44ec8db679495dd5816d1ec30
treec48799377d006b2e9d82ffd90699464cee224698
parent0ab038af6290c7fb52d4c26949d735692781b3d1
runtime: use futexes with 64-bit time on Linux

Linux introduced new syscalls to fix the year 2038 issue.
To still be able to use the old ones, the Kconfig option
COMPAT_32BIT_TIME would be necessary.

Use the new syscall with 64-bit values for futex by default.
Define _ENOSYS for detecting if it's not available.
Add a fallback to use the older syscall in case the new one is
not available, since Go runs on Linux from 2.6.32 on, per
https://go.dev/wiki/MinimumRequirements.

Updates #75133

Change-Id: I65daff0a3d06b55440ff05d8f5a9aa1c07eb201d
GitHub-Last-Rev: 96dd1bd84bd12d898e971157fc83da562cc4f6b4
GitHub-Pull-Request: golang/go#75306
Reviewed-on: https://go-review.googlesource.com/c/go/+/701615
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
19 files changed:
src/runtime/defs2_linux.go
src/runtime/defs_linux.go
src/runtime/defs_linux_386.go
src/runtime/defs_linux_amd64.go
src/runtime/defs_linux_arm.go
src/runtime/defs_linux_arm64.go
src/runtime/defs_linux_loong64.go
src/runtime/defs_linux_mips64x.go
src/runtime/defs_linux_mipsx.go
src/runtime/defs_linux_ppc64.go
src/runtime/defs_linux_ppc64le.go
src/runtime/defs_linux_riscv64.go
src/runtime/defs_linux_s390x.go
src/runtime/os_linux.go
src/runtime/os_linux_futex32.go [new file with mode: 0644]
src/runtime/os_linux_futex64.go [new file with mode: 0644]
src/runtime/sys_linux_386.s
src/runtime/sys_linux_arm.s
src/runtime/sys_linux_mipsx.s