[libc] [llvm] [libc] Add support for getpagesize. (PR #171713)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 11 10:15:22 PST 2025
================
@@ -0,0 +1,21 @@
+//===-- Linux implementation of getpagesize -------------------------------===//
+//
+// 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/unistd/getpagesize.h"
+
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/unistd/sysconf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, getpagesize, ()) {
+ return static_cast<int>(LIBC_NAMESPACE::sysconf(_SC_PAGESIZE));
----------------
Sterling-Augustine wrote:
Done.
https://github.com/llvm/llvm-project/pull/171713
More information about the llvm-commits
mailing list