--- src/sys/sys/mman.h 2008/07/23 17:22:33 1.9 +++ src/sys/sys/mman.h 2008/10/06 21:01:37 1.10 @@ -41,6 +41,12 @@ #ifndef _SYS__POSIX_H_ #include #endif +#ifndef _SYS_TYPES_H_ +#include +#endif +#ifndef _SYS_CDEFS_H_ +#include +#endif /* * Inheritance for minherit() @@ -128,6 +134,17 @@ #define MADV_SETMAP 11 /* set page table directory page for map */ /* + * Advice to posix_madvise() + */ +#if __POSIX_VISIBLE >= 200112 +#define POSIX_MADV_NORMAL MADV_NORMAL +#define POSIX_MADV_RANDOM MADV_RANDOM +#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL +#define POSIX_MADV_WILLNEED MADV_WILLNEED +#define POSIX_MADV_DONTNEED MADV_DONTNEED +#endif + +/* * mcontrol() must be used for these functions instead of madvise() */ #define MADV_CONTROL_START MADV_INVAL @@ -143,13 +160,6 @@ #define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */ #define MINCORE_SUPER 0x20 /* Page is a "super" page */ -#ifndef _SYS_TYPES_H_ -#include -#endif -#ifndef _SYS_CDEFS_H_ -#include -#endif - __BEGIN_DECLS #ifdef _P1003_1B_VISIBLE int mlockall (int); @@ -166,6 +176,9 @@ int mprotect (const void *, size_t, int) int msync (void *, size_t, int); int munlock (const void *, size_t); int munmap (void *, size_t); +#if __POSIX_VISIBLE >= 200112 +int posix_madvise(void *, size_t, int); +#endif #ifndef _POSIX_SOURCE int madvise (void *, size_t, int); int mcontrol (void *, size_t, int, off_t);