/*if ((data = mmap((caddr_t)0, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0)) == (caddr_t)(-1)) {
perror("mmap"); exit(1); }
if ((data = mmap((caddr_t)0, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, fd, 0)) == (caddr_t)(-1)) {
perror("mmap"); exit(1); }
if ((data = mmap((caddr_t)0, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)) == (caddr_t)(-1)) {
perror("mmap"); exit(1); }
*/if ((data = mmap((caddr_t)0, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, fd, 0)) == (caddr_t)(-1)) {
perror("mmap"); exit(1); }
But only variant with MAP_PRIVATE is good
I'm understanding what you used mmap function for acceleration executing of lisp program.
It occurs because of that that lisp program it appears in cache of kernel.
I think that it is necessary to try to separate a task of acceleration from a task of divided(shared) memory
Then it will be possible for a task of shared memory used the set functions shmget and her (it) companions, but a task of acceleration used mmap function. Then there will be an opportunity to switch (on|off) use mmap function at compilation
BoA