On Mon, Apr 19, 2010 at 7:49 PM, Brad <[email protected]> wrote: > Here is a diff to add posix_madvise() to libc. ... > -#define MADV_NORMAL 0 /* no further special treatment */ ... > +#define POSIX_MADV_NORMAL 0 /* no further special treatment */ ... > +#define MADV_NORMAL POSIX_MADV_NORMAL
If it's going to try to be standards compliant by defining the POSIX_* names independently of the traditional MADV_* macros, then it should go all the way: 1) hide the MADV_* macros inside #if __BSD_VISIBLE/#endif 2) ditto for madvise(), mincore(), minherit(), and mquery() 3) make <sys/mman.h> not require <sys/types.h> by including the following inside the #ifndef _KERNEL block: --- #include <sys/_types.h> #ifndef _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED_ typedef __size_t size_t; #endif #ifndef _OFF_T_DEFINED_ #define _OFF_T_DEFINED_ typedef __off_t off_t; #endif --- 4) implement posix_madvise() as a call to _thread_sys_madvise() instead of madvise() Philip Guenther
