summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-06-20 00:07:09 -0400
committerRich Felker <dalias@aerifal.cx>2018-06-20 00:07:09 -0400
commit0cd2be231481d68d244662bde25ad9cadbd7221d (patch)
tree586cb81d3f4ffae60276626b8a9b5a1b3ef59a34 /arch
parent7ea235b1be38c57c49b164c9762cf90be02dbc05 (diff)
downloadmusl-0cd2be231481d68d244662bde25ad9cadbd7221d.tar.gz
work around broken kernel struct ipc_perm on some big endian archs
the mode member of struct ipc_perm is specified by POSIX to have type mode_t, which is uniformly defined as unsigned int. however, Linux defines it with type __kernel_mode_t, and defines __kernel_mode_t as unsigned short on some archs. since there is a subsequent padding field, treating it as a 32-bit unsigned int works on little endian archs, but the order is backwards on big endian archs with the erroneous definition. since multiple archs are affected, remedy the situation with fixup code in the affected functions (shmctl, semctl, and msgctl) rather than repeating the same shims in syscall_arch.h for every affected arch.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/syscall_arch.h2
-rw-r--r--arch/m68k/syscall_arch.h1
-rw-r--r--arch/microblaze/syscall_arch.h2
-rw-r--r--arch/sh/syscall_arch.h2
4 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/syscall_arch.h b/arch/arm/syscall_arch.h
index 4db7d152..53fb155c 100644
--- a/arch/arm/syscall_arch.h
+++ b/arch/arm/syscall_arch.h
@@ -103,3 +103,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
#define VDSO_CGT_VER "LINUX_2.6"
#define SYSCALL_FADVISE_6_ARG
+
+#define SYSCALL_IPC_BROKEN_MODE
diff --git a/arch/m68k/syscall_arch.h b/arch/m68k/syscall_arch.h
index 53a4256f..af79c306 100644
--- a/arch/m68k/syscall_arch.h
+++ b/arch/m68k/syscall_arch.h
@@ -88,3 +88,4 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
}
#define SYSCALL_USE_SOCKETCALL
+#define SYSCALL_IPC_BROKEN_MODE
diff --git a/arch/microblaze/syscall_arch.h b/arch/microblaze/syscall_arch.h
index 8e2de7ea..6cf631ad 100644
--- a/arch/microblaze/syscall_arch.h
+++ b/arch/microblaze/syscall_arch.h
@@ -102,3 +102,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
#define SYSCALL_NO_INLINE
#endif
+
+#define SYSCALL_IPC_BROKEN_MODE
diff --git a/arch/sh/syscall_arch.h b/arch/sh/syscall_arch.h
index 84758fe0..48f61d94 100644
--- a/arch/sh/syscall_arch.h
+++ b/arch/sh/syscall_arch.h
@@ -86,3 +86,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
register long r1 __asm__("r1") = f;
__asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
}
+
+#define SYSCALL_IPC_BROKEN_MODE