[libc-commits] [libc] [libc][sys/sem] Add sys v sem headers and syscall wrapper implementation (PR #185914)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Thu Mar 12 07:43:57 PDT 2026
================
@@ -0,0 +1,86 @@
+//===-- Linux implementation of semctl ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/sys/sem/semctl.h"
+
+#include "hdr/errno_macros.h"
+#include "hdr/sys_ipc_macros.h"
+#include "hdr/sys_sem_macros.h"
+#include "hdr/types/struct_semid_ds.h"
+#include "hdr/types/struct_seminfo.h"
+#include "src/__support/OSUtil/syscall.h"
+#include "src/__support/common.h"
+#include "src/__support/libc_errno.h"
+#include <stdarg.h>
+#include <sys/syscall.h>
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, semctl, (int semid, int semnum, int cmd, ...)) {
----------------
SchrodingerZhu wrote:
The control flow is rather complicated here. Can you annotate each break and explain the required handling there?
https://github.com/llvm/llvm-project/pull/185914
More information about the libc-commits
mailing list