On 2/6/26 03:26, Warner Losh wrote:
From: Stacey Son <[email protected]>
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 <[email protected]>
Signed-off-by: Warner Losh <[email protected]>
---
bsd-user/bsd-misc.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/bsd-user/bsd-misc.h b/bsd-user/bsd-misc.h
index b722c63437..18520548fb 100644
--- a/bsd-user/bsd-misc.h
+++ b/bsd-user/bsd-misc.h
@@ -77,6 +77,18 @@ out:
return ret;
}
+/*
+ * System V Semaphores
+ */
+
+/* semget(2) */
+static inline abi_long do_bsd_semget(abi_long key, int nsems,
+ int target_flags)
+{
+ return get_errno(semget(key, nsems,
+ target_to_host_bitmask(target_flags, ipc_flags_tbl)));
+}
+
/* getdtablesize(2) */
static inline abi_long do_bsd_getdtablesize(void)
{
Doesn't FreeBSD have consistent ipc flags across targets?
I'm surprised the conversion is necessary.
Anyway,
Reviewed-by: Richard Henderson <[email protected]>
r~