diff options
Diffstat (limited to 'lib/libc/gen/pmadvise.c')
-rw-r--r-- | lib/libc/gen/pmadvise.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/libc/gen/pmadvise.c b/lib/libc/gen/pmadvise.c new file mode 100644 index 0000000..0dc77e3 --- /dev/null +++ b/lib/libc/gen/pmadvise.c @@ -0,0 +1,26 @@ +/* + * The contents of this file are in the public domain. + * Written by Garrett A. Wollman, 2000-10-07. + * + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/mman.h> +#include <errno.h> + +int +posix_madvise(void *address, size_t size, int how) +{ + int ret, saved_errno; + + saved_errno = errno; + if (madvise(address, size, how) == -1) { + ret = errno; + errno = saved_errno; + } else { + ret = 0; + } + return (ret); +} |