ipcs command results always empty
if ( ( i = shmget(k, 0x100000, IPC_CREAT | IPC_EXCL | 0660) ) < 0 ) {
fprintf( stderr, "%s: shmget() error, errno=%d (%s)\n",
argv[0], errno, strerror(errno) );
return(3);
}
$ ./sg a # creates shared memory segment using above code
$ ./sg a # run again, get expected error
./sg: shmget() error, errno=17 (File exists)
$ ipcs
Message Queues:
T ID KEY MODE OWNER GROUP
Shared Memory:
T ID KEY MODE OWNER GROUP
Semaphores:
T ID KEY MODE OWNER GROUP
$
Eventually, I run out of space for shared memory
and have no way to use ipcrm to get rid of these
"test" shared memory regions becasue I cannot
determine the shmid or shmkey because the ipcs
command doesn't provide me with this info.
Suggestions?
-Kurt Lloyd
PowerBook 12" Mac OS X (10.4.4)