[libc-commits] [libc] [libc] implement mlock/mlock2/munlock/mlockall/munlockall (PR #79645)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Fri Jan 26 12:41:57 PST 2024
https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/79645
None
>From e3a09dfaca3d013f816c46b4cb1bdd23783c55b8 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 eab0a987b920cd9..0cb8b7f8bf5251b 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 7e1cf892135acf9..40a663afd2595ca 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