about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--include/sys/mman.h1
-rw-r--r--src/mman/mincore.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/sys/mman.h b/include/sys/mman.h
index 0fa32e6a..136b45b3 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -33,6 +33,7 @@ void *mremap (void *, size_t, size_t, int, ...);
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 int madvise (void *, size_t, int);
+int mincore (void *, size_t, unsigned char *);
 #endif
 
 int shm_open (const char *, int, mode_t);
diff --git a/src/mman/mincore.c b/src/mman/mincore.c
new file mode 100644
index 00000000..4bb19f85
--- /dev/null
+++ b/src/mman/mincore.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <sys/mman.h>
+#include "syscall.h"
+
+int mincore (void *addr, size_t len, unsigned char *vec)
+{
+	return syscall(SYS_mincore, addr, len, vec);
+}