[llvm] [llvm][Support][Memory] Add memfd based fallback for strict W^X Linux systems (PR #98538)
Jannik Glückert via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 31 10:40:53 PDT 2024
================
@@ -67,6 +72,24 @@ static int getPosixProtectionFlags(unsigned Flags) {
return PROT_NONE;
}
+#if defined(__linux__)
+#ifndef MFD_CLOEXEC
+#define MFD_CLOEXEC 0x0001U
+#endif
+#ifndef MFD_EXEC
+#define MFD_EXEC 0x0010U
+#endif
+
+static inline int memfd_create(const char *name, int flags) {
----------------
Jannik2099 wrote:
not super relevant as it's static, but perhaps mimic the libc & syscall prototype, where `flags` is `unsigned int` ?
https://github.com/llvm/llvm-project/pull/98538
More information about the llvm-commits
mailing list