[libc-commits] [libc] [libc][sys] add header and functions for sys ipc (PR #182700)

Pengxiang Huang via libc-commits libc-commits at lists.llvm.org
Sun Feb 22 13:41:56 PST 2026


================
@@ -0,0 +1,28 @@
+//===-- Linux implementation of ftok -------------------------------------===//
+//
+// 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/ipc/ftok.h"
+
+#include "src/__support/common.h"
+#include "src/sys/stat/stat.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(key_t, ftok, (const char *path, int id)) {
+
+  // ftok implements based on stat
+  struct stat st;
+  if (LIBC_NAMESPACE::stat(path, &st) < 0)
----------------
Pengxiang-Huang wrote:

Sure

https://github.com/llvm/llvm-project/pull/182700


More information about the libc-commits mailing list