aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2018-05-10 01:11:19 +0200
committerLaurent Vivier <laurent@vivier.eu>2018-05-11 19:05:05 +0200
commitd3c6e8e98c00a801620ed7de7642c3bb957e15c6 (patch)
treed89150059dda88824bcc7e4e641ccf7d12b29c13 /linux-user
parentcbf358a667eaac4d305b43a47effd483021f38d7 (diff)
linux-user: fix flock/flock64 padding
include/uapi/asm-generic/fcntl.h insert a padding macro at the end of the structures flock and flock64. This macro is defined to "short __unused;" on sparc, and "long pad[4]" on mips. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Max Filippov <jcmvbkbc@gmail.com> Message-Id: <20180509231123.20864-3-laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall_defs.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index ec3f561685..e4cd87cc00 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2643,6 +2643,17 @@ struct target_statfs64 {
#define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
#endif
+#if defined(TARGET_SPARC)
+#define TARGET_ARCH_FLOCK_PAD abi_short __unused;
+#define TARGET_ARCH_FLOCK64_PAD abi_short __unused;
+#elif defined(TARGET_MIPS)
+#define TARGET_ARCH_FLOCK_PAD abi_long pad[4];
+#define TARGET_ARCH_FLOCK64_PAD
+#else
+#define TARGET_ARCH_FLOCK_PAD
+#define TARGET_ARCH_FLOCK64_PAD
+#endif
+
struct target_flock {
short l_type;
short l_whence;
@@ -2652,9 +2663,7 @@ struct target_flock {
abi_long l_sysid;
#endif
int l_pid;
-#if defined(TARGET_MIPS)
- abi_long pad[4];
-#endif
+ TARGET_ARCH_FLOCK_PAD
};
struct target_flock64 {
@@ -2663,6 +2672,7 @@ struct target_flock64 {
abi_llong l_start;
abi_llong l_len;
abi_int l_pid;
+ TARGET_ARCH_FLOCK64_PAD
};
struct target_f_owner_ex {