[mips64] Fix ipc syscalls
Mips defines CONFIG_ARCH_WANT_IPC_PARSE_VERSION for both 32 and 64-bit.
See arch/mips/Kconfig. Other supported arches do it for 32-bit only.
This translates in having to pass IPC_64 flag for mips32 and mips64.
We use __mips__ to pass the flag, which is also defined for both 32 and
64-bit.
Change fixes bionic smoke tests (sys_msg, sys_sem, sys_shm) for mips64.
Test: bionic-unit-tests --gtest_filter="sys_*.smoke"
Change-Id: I918e4ffafd2002bb3e62ee252406746778100031
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)