[libc] [llvm] [libc] Implement pkey_alloc/free/get/set/mprotect for x86_64 linux (PR #162362)

Jackson Stogel via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 12:49:52 PST 2025


================
@@ -0,0 +1,33 @@
+//===---------- Generic stub implementations for pkey functionality. ------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SYS_MMAN_LINUX_GENERIC_PKEY_COMMON_H_
+#define LLVM_SYS_MMAN_LINUX_GENERIC_PKEY_COMMON_H_
+
+#include "hdr/errno_macros.h" // For ENOSYS
+#include "src/__support/common.h"
+#include "src/__support/error_or.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace pkey_common {
+
+LIBC_INLINE ErrorOr<int> pkey_get(int pkey) {
+  (void)pkey;
+  return Error(ENOSYS);
+}
+
+LIBC_INLINE ErrorOr<int> pkey_set(int pkey, unsigned int access_rights) {
----------------
jtstogel wrote:

ditto, ty!

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


More information about the llvm-commits mailing list