Hi,
I am trying to play with madvise on my AMD machine running OpenSolaris.2009.06. 
However, getting the following error when I used to compile the below program 
with /usr/sfw/bin/g++. Please help me to resolve this. I am not sure whether 
the usage of madvise is correct or not? Please let me know.

error: `madvise' undeclared (first use this function)
error: (Each undeclared identifier is reported only once for each function it 
appears in.)

Program
=========
....
#include <sys/types.h>
#include <sys/mman.h>
...
...

int
main (void)
{
....
  
  int size = numOptions*sizeof(OptionData);
  data = (OptionData*)malloc(size);
  
  if (data == NULL) {
      perror("Fatal Error: malloc failed");
      exit(-1); 
  }
   
  int ret = madvise(data, size, MADV_ACCESS_MANY);
  if (ret == -1) {
      perror("Fatal Error: madvise failed");
         exit(-2);
  } 
  ...
  ...

return 0;
}
-- 
This message posted from opensolaris.org
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to