#include #include #include #include #include #include /* mnemonici di mode */ #include /* mnemonici di oflag */ //mmap-8.c int main (void) { int fd,i, i_scrivo, i_leggo,size=5*sizeof(float); float* ptr_shm; float* ptr_shm1; float* ptr_shm2; fd = shm_open("mymem", O_CREAT | O_EXCL |O_RDWR, S_IRUSR | S_IWUSR); ftruncate(fd,size); ptr_shm = mmap(NULL ,size, PROT_READ | PROT_WRITE, MAP_SHARED ,fd, 0); ptr_shm1=ptr_shm; ptr_shm2=ptr_shm; for(i_scrivo=0; i_scrivo