[libc-commits] [libc] [libc] implement mlock/mlock2/munlock/mlockall/munlockall (PR #79645)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Jan 29 07:17:25 PST 2024


https://github.com/SchrodingerZhu updated https://github.com/llvm/llvm-project/pull/79645

>From 8d098769b5f983ccb56d5356e8a0c57df635d7ff Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Fri, 26 Jan 2024 15:41:28 -0500
Subject: [PATCH] [libc] implement mlock/mlock2/munlock/mlockall/munlockall

---
 libc/spec/linux.td |  9 +++++++++
 libc/spec/posix.td | 20 ++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/libc/spec/linux.td b/libc/spec/linux.td
index eab0a987b920cd..0cb8b7f8bf5251 100644
--- a/libc/spec/linux.td
+++ b/libc/spec/linux.td
@@ -89,6 +89,15 @@ def Linux : StandardSpec<"Linux"> {
               ArgSpec<UnsignedCharPtr>,
             ]
         >,
+        FunctionSpec<
+          "mlock2",
+          RetValSpec<IntType>,
+          [
+            ArgSpec<VoidPtr>,
+            ArgSpec<SizeTType>,
+            ArgSpec<UnsignedIntType>,
+          ]
+        >,
       ]  // Functions
   >;
 
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index 7e1cf892135acf..40a663afd2595c 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -289,6 +289,26 @@ def POSIX : StandardSpec<"POSIX"> {
              ArgSpec<SizeTType>,
              ArgSpec<IntType>]
         >,
+        FunctionSpec<
+          "mlock",
+          RetValSpec<IntType>,
+          [ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
+        >,
+        FunctionSpec<
+          "munlock",
+          RetValSpec<IntType>,
+          [ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
+        >,
+        FunctionSpec<
+          "mlockall",
+          RetValSpec<IntType>,
+          [ArgSpec<IntType>]
+        >,
+        FunctionSpec<
+          "munlockall",
+          RetValSpec<IntType>,
+          [ArgSpec<VoidType>]
+        >,
       ]
   >;
 



More information about the libc-commits mailing list