mincore syscall wrapper
authorRich Felker <dalias@aerifal.cx>
Sun, 9 Sep 2012 20:37:19 +0000 (16:37 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 9 Sep 2012 20:37:19 +0000 (16:37 -0400)
include/sys/mman.h
src/mman/mincore.c [new file with mode: 0644]

index 0fa32e6a0aaa8d69295ca4f7465d7e55a59e3764..136b45b349f1242d680fc89dab25b67938ef1cae 100644 (file)
@@ -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 (file)
index 0000000..4bb19f8
--- /dev/null
@@ -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);
+}