summaryrefslogtreecommitdiff
path: root/src/runtime/defs_linux_386.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-11-19 14:56:49 -0500
committerAustin Clements <austin@google.com>2014-11-19 14:56:49 -0500
commit235dd4c7f2e1c75498e6ff5c81ba0d6269464993 (patch)
tree80a985045922cb181a71c805fe4a034551a49d37 /src/runtime/defs_linux_386.go
parent9a7a6cdead943e05114d54daf86b075397a32029 (diff)
downloadgo-235dd4c7f2e1c75498e6ff5c81ba0d6269464993.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://codereview.appspot.com/179970044
Diffstat (limited to 'src/runtime/defs_linux_386.go')
-rw-r--r--src/runtime/defs_linux_386.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/defs_linux_386.go b/src/runtime/defs_linux_386.go
index ddf592c91..f55924b61 100644
--- a/src/runtime/defs_linux_386.go
+++ b/src/runtime/defs_linux_386.go
@@ -155,10 +155,11 @@ type sigactiont struct {
}
type siginfo struct {
- si_signo int32
- si_errno int32
- si_code int32
- _sifields [116]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 uint32
}
type sigaltstackt struct {