[libc-commits] [libc] [libc][sys/shm] Implement shmctl and add remaining constants. (PR #239839)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Mon Nov 9 11:58:08 PST 2026


================
@@ -28,4 +32,25 @@
   __LLVM_LIBC_CAST(reinterpret_cast, void *,                                   \
                    __LLVM_LIBC_CAST(static_cast, intptr_t, -1))
 
+// shmctl commands
+#define SHM_LOCK 11
+#define SHM_UNLOCK 12
+#define SHM_STAT 13
+#define SHM_INFO 14
+#define SHM_STAT_ANY 15
+
+// shm_mode upper byte flags in ipc_perm.
+#define SHM_DEST 01000
+#define SHM_LOCKED 02000
+
+// shmflg bits for shmget
+#define SHM_HUGETLB 04000
+#define SHM_NORESERVE 010000
+
+// Huge page size encoding when SHM_HUGETLB is set.
+#define SHM_HUGE_SHIFT 26
+#define SHM_HUGE_MASK 0x3f
+#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT)
----------------
vonosmas wrote:

Done

https://github.com/llvm/llvm-project/pull/239839


More information about the libc-commits mailing list