Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
MADVISE.cpp
Go to the documentation of this file.
1// checking for madvise() in <sys/mman.h>
2
3
25#include <sys/mman.h> // for madvise(), MADV_WILLNEED
26#include <sys/types.h> // for caddr_t
27
28
29int main (int argc, char *argv[])
30{
31 const caddr_t addr = (caddr_t)argv;
32
33 const int result = madvise (addr, argc, MADV_WILLNEED);
34
35 if (1 < argc) {
36 // invoke with any command line arguments to test
37 return result;
38 }
39
40 // always succeed when invoked without arguments
41 return 0;
42}
#define addr
Definition 17.names.cpp:446
volatile int result
#define main