From: Stacey Son <sson@FreeBSD.org>
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>
---
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 ad248c3b79..cc489ab13c 100644
--- a/bsd-user/bsd-misc.h
+++ b/bsd-user/bsd-misc.h
@@ -72,6 +72,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)
{
--
2.52.0