diff options
| author | Rhys Hiltner <rhys@justin.tv> | 2021-09-29 17:35:27 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-11-02 05:43:05 +0000 |
| commit | a97c527ac491cc13f6778010a2a81c84642ea1ca (patch) | |
| tree | c42e74ac36841f3ae0b439ef44243f9a2fcd0502 /src/runtime/export_linux_test.go | |
| parent | 6f327f7b889b81549d551ce6963067267578bd70 (diff) | |
| download | go-a97c527ac491cc13f6778010a2a81c84642ea1ca.tar.xz | |
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>
Diffstat (limited to 'src/runtime/export_linux_test.go')
| -rw-r--r-- | src/runtime/export_linux_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/export_linux_test.go b/src/runtime/export_linux_test.go index b7c901f238..dea94a934c 100644 --- a/src/runtime/export_linux_test.go +++ b/src/runtime/export_linux_test.go @@ -8,11 +8,16 @@ package runtime import "unsafe" +const SiginfoMaxSize = _si_max_size +const SigeventMaxSize = _sigev_max_size + var NewOSProc0 = newosproc0 var Mincore = mincore var Add = add type EpollEvent epollevent +type Siginfo siginfo +type Sigevent sigevent func Epollctl(epfd, op, fd int32, ev unsafe.Pointer) int32 { return epollctl(epfd, op, fd, (*epollevent)(ev)) |
