From a660180c6a93681c6efb54fb5826c08d4df60208 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 9 Sep 2012 16:37:19 -0400 Subject: [PATCH] mincore syscall wrapper --- include/sys/mman.h | 1 + src/mman/mincore.c | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/mman/mincore.c 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 +#include "syscall.h" + +int mincore (void *addr, size_t len, unsigned char *vec) +{ + return syscall(SYS_mincore, addr, len, vec); +} -- 2.25.1