bsd-user: Add do_bsd_semget implementation
Add implementation of semget(2) syscall to get System V semaphore set identifier. Converts target IPC flags to host format. Signed-off-by: Stacey Son <sson@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
Stacey Son committed
Feb 2, 2026 at 16:44 UTC
39fb6a5d09c1af4ab937234c6ba6b03c4fa27d97
1 file changed
+12
bsd-user/bsd-misc.h
+12
@@ -65,6 +65,18 @@ out:
65
return ret;
66
}
67
68
+/*
69
+ * System V Semaphores
70
+ */
71
+
72
+/* semget(2) */
73
+static inline abi_long do_bsd_semget(abi_long key, int nsems,
74
+ int target_flags)
75
+{
76
+ return get_errno(semget(key, nsems,
77
+ target_to_host_bitmask(target_flags, ipc_flags_tbl)));
78
+}
79
+
80
/* getdtablesize(2) */
81
static inline abi_long do_bsd_getdtablesize(void)
82
{