diff options
author | Austin Clements <austin@google.com> | 2014-11-19 14:56:49 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2014-11-19 14:56:49 -0500 |
commit | f4a525452e1442c08e2a973a5871445258ed0054 (patch) | |
tree | 821d640aceb3688bf4277f0fd6eaad6b3e33deaf /src/runtime/defs_linux_amd64.go | |
parent | d11a42595940df79bbd73bfe54469f840952ab79 (diff) | |
download | go-f4a525452e1442c08e2a973a5871445258ed0054.tar.gz go-f4a525452e1442c08e2a973a5871445258ed0054.zip |
[dev.cc] runtime: add explicit siginfo.si_addr field
struct siginfo_t's si_addr field is part of a union.
Previously, we represented this union in Go using an opaque
byte array and accessed the si_addr field using unsafe (and
wrong on 386 and arm!) pointer arithmetic. Since si_addr is
the only field we use from this union, this replaces the
opaque byte array with an explicit declaration of the si_addr
field and accesses it directly.
LGTM=minux, rsc
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/179970044
Diffstat (limited to 'src/runtime/defs_linux_amd64.go')
-rw-r--r-- | src/runtime/defs_linux_amd64.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/defs_linux_amd64.go b/src/runtime/defs_linux_amd64.go index 7f8f5816c6..a73f475148 100644 --- a/src/runtime/defs_linux_amd64.go +++ b/src/runtime/defs_linux_amd64.go @@ -117,11 +117,11 @@ type sigactiont struct { } type siginfo struct { - si_signo int32 - si_errno int32 - si_code int32 - pad_cgo_0 [4]byte - _sifields [112]byte + si_signo int32 + si_errno int32 + si_code int32 + // below here is a union; si_addr is the only field we use + si_addr uint64 } type itimerval struct { |