about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-07-30 13:07:55 -0400
committerRich Felker <dalias@aerifal.cx>2019-07-30 14:23:56 -0400
commitf56d57f8a7aa536d40014933841a8b22f9c10328 (patch)
treef34e16245f19c8b1fcf739c9a8e9526d44bbba5d /src
parent722a1ae3351a03ab25010dbebd492eced664853b (diff)
downloadmusl-f56d57f8a7aa536d40014933841a8b22f9c10328.tar.gz
musl-f56d57f8a7aa536d40014933841a8b22f9c10328.tar.xz
musl-f56d57f8a7aa536d40014933841a8b22f9c10328.zip
move IPC_64 from public bits/ipc.h to syscall_arch.h
the definition of the IPC_64 macro controls the interface between libc
and the kernel through syscalls; it's not a public API. the meaning is
rather obscure. long ago, Linux's sysvipc *id_ds structures used
16-bit uids/gids and wrong types for a few other fields. this was in
the libc5 era, before glibc. the IPC_64 flag (64 is a misnomer; it's
more like 32) tells the kernel to use the modern[-ish] versions of the
structures.

the definition of IPC_64 has nothing to do with whether the arch is
32- or 64-bit. rather, due to either historical accident or
intentional obnoxiousness, the kernel only accepts and masks off the
0x100 IPC_64 flag conditional on CONFIG_ARCH_WANT_IPC_PARSE_VERSION,
i.e. for archs that want to provide, or that accidentally provided,
both. for archs which don't define this option, no masking is
performed and commands with the 0x100 bit set will fail as invalid. so
ultimately, the definition is just a matter of matching an arbitrary
switch defined per-arch in the kernel.
Diffstat (limited to 'src')
-rw-r--r--src/ipc/ipc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipc/ipc.h b/src/ipc/ipc.h
index 30ab939a..36f3e213 100644
--- a/src/ipc/ipc.h
+++ b/src/ipc/ipc.h
@@ -1,3 +1,5 @@
+#include "syscall.h"
+
 #define IPCOP_semop      1
 #define IPCOP_semget     2
 #define IPCOP_semctl     3
@@ -10,3 +12,7 @@
 #define IPCOP_shmdt     22
 #define IPCOP_shmget    23
 #define IPCOP_shmctl    24
+
+#ifndef IPC_64
+#define IPC_64 0x100
+#endif