Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!hplabs!hpcea!hpfcdc!rml From: rml@hpfcdc.HP.COM (Bob Lenk) Newsgroups: net.unix-wizards Subject: Re: System V shared memory and Ultrix ? Message-ID: <630007@hpfcdc.HP.COM> Date: Fri, 26-Sep-86 15:46:55 EDT Article-I.D.: hpfcdc.630007 Posted: Fri Sep 26 15:46:55 1986 Date-Received: Thu, 2-Oct-86 20:51:31 EDT References: <547@rna.UUCP> Organization: HP Ft. Collins, Co. Lines: 19 > > Is the shared memory segment automatically destroyed if no process has > > it "open" ? > > However, there are two FLAGs (at least on my vax) SHM_CLEAR and SHM_DEST > that clear the segment on the next attach and destroy it when no one is > attached to it, respectively. cat /usr/include/sys/shm.h to see if they > are on you machine as well. These flags are in on System V implementations, but they are not documented or accessable to the user (eg. through shmget or shmctl). The only way to get something like what was requested is to explicitly remove the segement (with shmctl (,IPC_RMID,)); this must be done after the last attach (as subsequent attaches will fail). What the implementation does, if any processes have the segement attached at the time of the IPC_RMID, is to set the SHM_DEST bit. On the last detach, the segment is actually destroyed. Bob Lenk {ihnp4, hplabs}!hpfcla!rml