Messages in this thread |  | | | Subject | Re: 2.3.51 -- I am still seeing the"shmget: shm filesystem not mounted" error | | From | Christoph Rohland <> | | Date | 13 Mar 2000 16:49:30 +0100 |
| |
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > I don't believe it. Solaris, Tru64 and BSD all disallow attaches after > > IPC_RMID. (I just tested them, in fact.) The *segment* is still alive until > > nattch==0, of course, but nobody can attach to it. > > Just how are you testing. My test set works. > > > Apps full of linuxisms are a pain to port. > > Indeed. I've also got a test patch to fix the API breakage in the shmfs code > and it seems very easy to fix, with the added bonus that I mended chrooted > sys5 ipc (wrongly in the draft patch 8))
test prog attached.
Greetings Christoph
-- #include <stdlib.h> #include <stdio.h>
#include <errno.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h>
int main (int ac, char **av) { int seg, stat; if ((seg = shmget (IPC_PRIVATE, 4000, IPC_CREAT| 0600)) == -1) { perror("shmget"); exit (1); } if (shmat (seg, 0, 0) == (void*) -1) { perror ("shmat"); exit (2); } if (shmctl (seg, IPC_RMID, NULL) == -1) { perror ("shmctl"); exit (2); } switch (fork()) { case -1: perror ("fork"); return (3); case 0: if (shmat (seg, 0, 0) != (void*) -1) printf ("shmat in client ok\n"); else perror ("shmat in client failed"); return (0); default: wait(&stat); } exit (0); } |  |