From dd8bbc76c579767fb037b90cf7f49d8d41b7f3b0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 15 Nov 2019 10:43:37 +0100 Subject: [PATCH] syscall: fix EpollEvent padding on mips64{,le} Like on other 64-bit GOARCHes, EpollEvent needs padding before Fd for mips64 and mips64le. Change-Id: I87773a1b305552ab4ed039623b40d2fff1f20d9b Reviewed-on: https://go-review.googlesource.com/c/go/+/207298 Run-TryBot: Tobias Klauser Reviewed-by: Ian Lance Taylor --- src/syscall/types_linux.go | 3 ++- src/syscall/ztypes_linux_mips64.go | 1 + src/syscall/ztypes_linux_mips64le.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/syscall/types_linux.go b/src/syscall/types_linux.go index 20abda2473..b47c3236c0 100644 --- a/src/syscall/types_linux.go +++ b/src/syscall/types_linux.go @@ -116,7 +116,8 @@ struct my_epoll_event { // alignment requirements of EABI int32_t padFd; #endif -#if defined(__powerpc64__) || defined(__s390x__) || (defined(__riscv_xlen) && __riscv_xlen == 64) +#if defined(__powerpc64__) || defined(__s390x__) || (defined(__riscv_xlen) && __riscv_xlen == 64) \ + || (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64) int32_t _padFd; #endif int32_t fd; diff --git a/src/syscall/ztypes_linux_mips64.go b/src/syscall/ztypes_linux_mips64.go index cfcfd85b35..75a5bc4589 100644 --- a/src/syscall/ztypes_linux_mips64.go +++ b/src/syscall/ztypes_linux_mips64.go @@ -569,6 +569,7 @@ type Ustat_t struct { type EpollEvent struct { Events uint32 + _ int32 Fd int32 Pad int32 } diff --git a/src/syscall/ztypes_linux_mips64le.go b/src/syscall/ztypes_linux_mips64le.go index cfcfd85b35..75a5bc4589 100644 --- a/src/syscall/ztypes_linux_mips64le.go +++ b/src/syscall/ztypes_linux_mips64le.go @@ -569,6 +569,7 @@ type Ustat_t struct { type EpollEvent struct { Events uint32 + _ int32 Fd int32 Pad int32 } -- 2.51.0