Thursday, 15 August 2013

c - Reallocation of Shared Memory -



c - Reallocation of Shared Memory -

in order reallocate shared memory using mremap enlarge particular shared memory size. next statement beingness used in order accomplish objective:

char *mem = (char*)mremap(addr, sizeof(addr), mem_range + 1, mremap_maymove);

despite inclusion of:

#define _gnu_source #include <sys/mman.h>

eclipse showing symbol 'mremap_maymove' not resolved.

however, given eclipse showing above mentioned error, code beingness compiled.

the next shows scenario:

thanks in advance!

the next code compiles , links without errors or warnings on suse linux sles11:

gcc -wall -o test test.c #define _gnu_source #include <sys/mman.h> #include <stdio.h> int main() { void *oldmapaddress = null; size_t oldmapsize = 512; size_t newmapsize = 1024; void *newmapaddress = null; newmapaddress = mremap(oldmapaddress, oldmapsize, newmapsize, mremap_maymove); return(0); }

the above code not executed. compiler/linker proof.

c linux eclipse mmap

No comments:

Post a Comment