]> Cypherpunks repositories - gostls13.git/commit
runtime: add padding to Linux kernel structures
authorRhys Hiltner <rhys@justin.tv>
Thu, 30 Sep 2021 00:35:27 +0000 (17:35 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 2 Nov 2021 05:43:05 +0000 (05:43 +0000)
commita97c527ac491cc13f6778010a2a81c84642ea1ca
treec42e74ac36841f3ae0b439ef44243f9a2fcd0502
parent6f327f7b889b81549d551ce6963067267578bd70
runtime: add padding to Linux kernel structures

Go exchanges siginfo and sigevent structures with the kernel. They
contain unions, but Go's use is limited to the first few fields. Pad out
the rest so the size Go sees is the same as what the Linux kernel sees.

This is a follow-up to CL 342052 which added the sigevent struct without
padding, and to CL 353136 which added the padding but with an assertion
that confused several type-checkers. It updates the siginfo struct as
well so there are no bad examples in the defs_linux_*.go files.

Reviewed-on: https://go-review.googlesource.com/c/go/+/353136

Change-Id: I9610632ff0ec43eba91f560536f5441fa907b36f
Reviewed-on: https://go-review.googlesource.com/c/go/+/360094
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
13 files changed:
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_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/export_linux_test.go
src/runtime/os_linux.go
src/runtime/runtime_linux_test.go