2
0
Fork 0

libc: add mlock and munlock dummies

This commit is contained in:
Emery Hemingway 2020-05-27 17:55:32 +05:30
parent 0c9f23f6e9
commit 2d0ba4b8a0
1 changed files with 26 additions and 0 deletions

View File

@ -38,3 +38,29 @@ index 8e75e59589..2bb98b1456 100644
SRC_C = $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(LIBC_LOCALE_DIR)/*.c)))
commit 81fc78f8e0ac66a7275e149f7f7fdc5f4f1f2979
Author: Emery Hemingway <ehmry@posteo.net>
Date: Wed May 27 16:35:16 2020 +0530
libc: add mlock and munlock dummies
diff --git a/repos/libports/src/lib/libc/dummies.cc b/repos/libports/src/lib/libc/dummies.cc
index 37c2c83f89..bc2f15a90a 100644
--- a/repos/libports/src/lib/libc/dummies.cc
+++ b/repos/libports/src/lib/libc/dummies.cc
@@ -221,5 +221,15 @@ int __attribute__((weak)) madvise(void *addr, size_t length, int advice)
const struct res_sym __p_type_syms[] = { };
+#define DUMMY_EPERM(ret_type, ret_val, name, args) __attribute__((weak)) \
+ret_type name args \
+{ \
+ errno = EPERM; \
+ return ret_val; \
+}
+
+DUMMY_EPERM(int, -1, mlock, (const void *, size_t));
+DUMMY_EPERM(int, -1, munlock, (const void *, size_t));
+
} /* extern "C" */