Hello,

I'm currently using Redhat Enterprise Linux 3 (Kernel 2.4.21-27 smp).
I use a shared memory segment to communicate between three processes.


statusShmDes = shmget(1300, sizeof(struct _status), /* set read/write access to all */
IPC_CREAT | SHM_W | SHM_R | SHM_W>>3 | SHM_W>>6 | SHM_R>>3 | SHM_R>>6);
if (statusShmDes == -1)
{
perror("Can't get shared memory\n");
exit(1);
}
gDMAStatus = (struct _status *) shmat(statusShmDes, NULL, 0);


shmctl(statusShmDes,IPC_STAT,&shmidds);

fprintf(stderr,"shmidds.shm_perm.uid %i\n",shmidds.shm_perm.uid);
fprintf(stderr,"shmidds.shm_perm.gid %i\n",shmidds.shm_perm.gid);
fprintf(stderr,"shmidds.shm_perm.cuid %i\n",shmidds.shm_perm.cuid);
fprintf(stderr,"shmidds.shm_perm.cgid %i\n",shmidds.shm_perm.cgid);
fprintf(stderr,"shmidds.shm_perm.mode %i\n",shmidds.shm_perm.mode);


Most of the time the permission mode (shm_perm.mode) is 438 (110110110), which is what I expect.
But somethimes the permission mode is zero. As a result the shared memory is acessable, but not writeable.
* My processes run as root.
* I do not remove (shmctl(statusShmDes,IPC_RMID,NULL) ) the shared memory in any of my processes.

Any ideas why the permission mode is 0 ?
Gerhard