Merge "[mips64] Fix ipc syscalls" am: ce4d419f7a
am: c2e6d5e4e9
Change-Id: Iccc78df6555e508c9c6fa68633864f3a87771136
diff --git a/libc/bionic/sys_msg.cpp b/libc/bionic/sys_msg.cpp
index 462c83b..4880356 100644
--- a/libc/bionic/sys_msg.cpp
+++ b/libc/bionic/sys_msg.cpp
@@ -32,8 +32,9 @@
#include <unistd.h>
int msgctl(int id, int cmd, msqid_ds* buf) {
-#if !defined(__LP64__)
+#if !defined(__LP64__) || defined(__mips__)
// Annoyingly, the kernel requires this for 32-bit but rejects it for 64-bit.
+ // Mips64 is an exception to this, it requires the flag.
cmd |= IPC_64;
#endif
#if defined(SYS_msgctl)
diff --git a/libc/bionic/sys_sem.cpp b/libc/bionic/sys_sem.cpp
index 058cfef..5e2a05c 100644
--- a/libc/bionic/sys_sem.cpp
+++ b/libc/bionic/sys_sem.cpp
@@ -33,8 +33,9 @@
#include <unistd.h>
int semctl(int id, int num, int cmd, ...) {
-#if !defined(__LP64__)
+#if !defined(__LP64__) || defined(__mips__)
// Annoyingly, the kernel requires this for 32-bit but rejects it for 64-bit.
+ // Mips64 is an exception to this, it requires the flag.
cmd |= IPC_64;
#endif
va_list ap;
diff --git a/libc/bionic/sys_shm.cpp b/libc/bionic/sys_shm.cpp
index f780e04..f3b26e7 100644
--- a/libc/bionic/sys_shm.cpp
+++ b/libc/bionic/sys_shm.cpp
@@ -45,8 +45,9 @@
}
int shmctl(int id, int cmd, struct shmid_ds* buf) {
-#if !defined(__LP64__)
+#if !defined(__LP64__) || defined(__mips__)
// Annoyingly, the kernel requires this for 32-bit but rejects it for 64-bit.
+ // Mips64 is an exception to this, it requires the flag.
cmd |= IPC_64;
#endif
#if defined(SYS_shmctl)