Commit 39fb6a5d09 for qemu.org
commit 39fb6a5d09c1af4ab937234c6ba6b03c4fa27d97
Author: Stacey Son <sson@FreeBSD.org>
Date: Mon Feb 2 16:44:22 2026 -0700
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>
diff --git a/bsd-user/bsd-misc.h b/bsd-user/bsd-misc.h
index 9f1cc8a0cd..3dffb977a5 100644
--- a/bsd-user/bsd-misc.h
+++ b/bsd-user/bsd-misc.h
@@ -65,6 +65,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)
{