My application needs several areas of shared memory, and I am getting an error ("No such device") on the second call to mmap(). The first call works fine. Here a simple program that shows the error (compiled with gcc -o mmaptest mmaptest.c -lrt): #include #include #include #include #include #include #include int main() { int shm_fd1, shm_fd2; char *mmap1, *mmap2; /* get fd for each block of memory */ shm_fd1 = shm_open("/block1", O_CREAT | O_RDWR, 0666); if (shm_fd1 == -1) { fprintf(stderr, "Couldn't get fd for block1 (%s)\n", strerror(errno)); exit(1); } shm_fd2 = shm_open("/block2", O_CREAT | O_RDWR, 0666); if (shm_fd2 == -1) { fprintf(stderr, "Couldn't get fd for /UNI_queue (%s)\n", strerror(errno)); exit(1); } /* map each block */ mmap1 = mmap(NULL, 524304, PROT_WRITE | PROT_READ, MAP_SHARED, shm_fd1, 0); if (mmap1 == (char *)-1) { fprintf(stderr, "Couldn't map memory for /block1 (%s)\n", strerror(errno)); exit(1); } mmap2 = mmap(NULL, 524304, PROT_WRITE | PROT_READ, MAP_SHARED, shm_fd2, 0); if (mmap2 == (char *)-1) { fprintf(stderr, "Couldn't map memory for /block2 (%s)\n", strerror(errno)); exit(1); } fprintf(stdout, "Shared memory initialized\n"); exit(0); } The problem does not seem to depend on the size of the requested memory. The program always returns with "Couldn't map memory for /block2 (No such device)" Steve Bardwell