Kishore Kumar Pusukuri
2010-08-27 08:00:11 UTC
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.
457: error: `madvise' undeclared (first use this function)
457: 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;
}
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.
457: error: `madvise' undeclared (first use this function)
457: 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
This message posted from opensolaris.org