diff options
Diffstat (limited to 'support/sys-mman.c')
-rw-r--r-- | support/sys-mman.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/support/sys-mman.c b/support/sys-mman.c new file mode 100644 index 00000000000..a91f4f841e6 --- /dev/null +++ b/support/sys-mman.c @@ -0,0 +1,36 @@ +/* + * <sys/mman.h> wrapper functions. + * + * Authors: + * Jonathan Pryor (jonpryor@vt.edu) + * + * Copyright (C) 2004 Jonathan Pryor + */ + +#define _XOPEN_SOURCE 600 + +#include <sys/types.h> +#include <sys/mman.h> +#include <errno.h> + +#include "map.h" +#include "mph.h" + +G_BEGIN_DECLS + +gint32 +Mono_Posix_Syscall_posix_madvise (void *addr, mph_size_t len, gint32 advice) +{ + mph_return_if_size_t_overflow (len); + + if (Mono_Posix_FromPosixMadviseAdvice (advice, &advice) == -1) + return -1; + + return posix_madvise (addr, (size_t) len, advice); +} + +G_END_DECLS + +/* + * vim: noexpandtab + */ |