Skip to content

Commit

Permalink
syscall: fix epoll_event struct for ppc64le/ppc64
Browse files Browse the repository at this point in the history
The existing epoll_event structure used by many of
the epoll_* syscalls was defined incorrectly
for use with ppc64le & ppc64 in the syscall
directory.  This resulted in the caller getting
incorrect information on return from these
syscalls.  This caused failures in fsnotify as
well as builds with upstream Docker.  The
structure is defined correctly in gccgo.

This adds a pad field that is expected for
these syscalls on ppc64le, ppc64.
Fixes #15135

Fixes #15288

Change-Id: If7e8ea9eb1d1ca5182c8dc0f935b334127341ffd
Reviewed-on: https://go-review.googlesource.com/21582
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/22207
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
laboger authored and adg committed Apr 19, 2016
1 parent 5fdefe9 commit df80157
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/syscall/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ struct my_epoll_event {
// padding is not specified in linux/eventpoll.h but added to conform to the
// alignment requirements of EABI
int32_t padFd;
#endif
#ifdef __powerpc64__
int32_t _padFd;
#endif
int32_t fd;
int32_t pad;
Expand Down
7 changes: 4 additions & 3 deletions src/syscall/ztypes_linux_ppc64.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,10 @@ type Ustat_t struct {
}

type EpollEvent struct {
Events uint32
Fd int32
Pad int32
Events uint32
X_padFd int32
Fd int32
Pad int32
}

const (
Expand Down
7 changes: 4 additions & 3 deletions src/syscall/ztypes_linux_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,10 @@ type Ustat_t struct {
}

type EpollEvent struct {
Events uint32
Fd int32
Pad int32
Events uint32
X_padFd int32
Fd int32
Pad int32
}

const (
Expand Down

0 comments on commit df80157

Please sign in to comment.