From 52ab431487773bc9dd1b0766228b1cf3944126bf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 6 Nov 2019 08:41:42 +0100 Subject: [PATCH] unix: fix EpollEvent padding on mips64{,le} Like on other 64-bit GOARCHes, EpollEvent needs padding before Fd for mips64 and mips64le. Change-Id: I934368ba22ef7bf3a25949649613c2a03928bf83 Reviewed-on: https://go-review.googlesource.com/c/sys/+/207278 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- unix/linux/types.go | 3 ++- unix/ztypes_linux_mips64.go | 1 + unix/ztypes_linux_mips64le.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/unix/linux/types.go b/unix/linux/types.go index 4882ad40..4a6a224e 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -283,7 +283,8 @@ 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; -#elif defined(__powerpc64__) || defined(__s390x__) || defined(__sparc__) || defined(__riscv) +#elif defined(__powerpc64__) || defined(__s390x__) || defined(__sparc__) || defined(__riscv) \ + || (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64) int32_t _padFd; #endif int32_t fd; diff --git a/unix/ztypes_linux_mips64.go b/unix/ztypes_linux_mips64.go index 81a818b0..c787be35 100644 --- a/unix/ztypes_linux_mips64.go +++ b/unix/ztypes_linux_mips64.go @@ -783,6 +783,7 @@ type Ustat_t struct { type EpollEvent struct { Events uint32 + _ int32 Fd int32 Pad int32 } diff --git a/unix/ztypes_linux_mips64le.go b/unix/ztypes_linux_mips64le.go index 214e345b..54191231 100644 --- a/unix/ztypes_linux_mips64le.go +++ b/unix/ztypes_linux_mips64le.go @@ -783,6 +783,7 @@ type Ustat_t struct { type EpollEvent struct { Events uint32 + _ int32 Fd int32 Pad int32 }