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_arm.go | |
parent | d11a42595940df79bbd73bfe54469f840952ab79 (diff) | |
download | go-git-f4a525452e1442c08e2a973a5871445258ed0054.tar.gz |
[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_arm.go')
-rw-r--r-- | src/runtime/defs_linux_arm.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/defs_linux_arm.go b/src/runtime/defs_linux_arm.go index a874b15941..c3a6e2f019 100644 --- a/src/runtime/defs_linux_arm.go +++ b/src/runtime/defs_linux_arm.go @@ -147,10 +147,11 @@ type itimerval struct { } type siginfo struct { - si_signo int32 - si_errno int32 - si_code int32 - _sifields [4]uint8 + si_signo int32 + si_errno int32 + si_code int32 + // below here is a union; si_addr is the only field we use + si_addr uint32 } type sigactiont struct { |