[libc-commits] [libc] [libc] Add `shm_open/shm_unlink` (PR #84974)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Mar 12 13:35:28 PDT 2024


================
@@ -0,0 +1,51 @@
+//===---------- Shared implementations for shm_open/shm_unlink ------------===//
+//
+// 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/__support/CPP/array.h"
+#include "src/__support/CPP/optional.h"
+#include "src/__support/CPP/string_view.h"
+#include "src/errno/libc_errno.h"
+#include "src/string/memchr.h"
+#include "src/string/memcpy.h"
+#include <asm/errno.h>
+#include <linux/limits.h>
----------------
nickdesaulniers wrote:

What are you using from `linux/limits.h`? `NAME_MAX`? I wonder if you should be using `_POSIX_HOST_NAME_MAX` instead (i.e. POSIX values for POSIX APIs). Otherwise this implementation will not work outside of linux as written.

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


More information about the libc-commits mailing list