 +int mlockall(int flags);
 +int munlockall(void);
 +int mprotect(void *addr, size_t len, int prot);
++
++#ifdef _DEFAULT_SOURCE
++int madvise(void *addr, size_t len, int advice);
++#endif
 +
 +#ifdef __cplusplus
 +}  // extern "C"

+
+// Advice to 'madvise'.
+#ifdef _DEFAULT_SOURCE
+# define MADV_NOHUGEPAGE  15
+#endif
+
+void *mmap(void *addr, size_t length, int prot, int flags, int fd,

+// mprotect is weak to allow an optional definition with Intel's trts_mprotect.
+__attribute__((weak))
+int mprotect(void *addr, size_t len, int prot) {
+  errno = ENOSYS;
+  return -1;
+}
+
+int madvise(void *addr, size_t len, int advice) {
+  errno = ENOSYS;
+  return -1;
+}
