aos/lib/libc/gen/pmadvise.c
Daniel Schwyn 6d444bf552 Main handout
Signed-off-by: Daniel Schwyn <daniel.schwyn@inf.ethz.ch>
2022-03-03 14:57:51 +01:00

27 lines
425 B
C

/*
* 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);
}