Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!retix!jay From: jay@retix.retix.retix.com (Jay Logue) Newsgroups: comp.unix.internals Subject: Re: shmat() & shmdt() questions. Message-ID: Date: 14 Sep 90 20:19:54 GMT References: <24482@adm.BRL.MIL> <1990Sep13.121318.24305@virtech.uucp> Sender: jay@retix.retix.COM Organization: Retix, Santa Monica Lines: 40 In-reply-to: cpcahil@virtech.uucp's message of 13 Sep 90 12:13:18 GMT In article <1990Sep13.121318.24305@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) writes: >In article <24482@adm.BRL.MIL> TAYBENGH%NUSDISCS.BITNET@cunyvm.cuny.edu writes: > > [ ... ] > >> 3) if a process quit without shmdt() the shared memory it attached >>to, will the OS detect and decrement the shm_nattch in structure sgmid_ds? > >Yes. And if this segment is designed to be a temporary segment that is >supposed to be removed when the last program is done with it, you can >run shmctl(... IPC_RM) once you have attached to it and then it will ^^^^^^ >be removed when the total number of attached processes drops to zero. What is IPC_RM? It is not mentioned in my AT&T System V/386 book nor is it present in any of the header files on my SCO Unix 386 system. The closest shmctl command value listed in the AT&T book is IPC_RMID, which is used to remove the shmid along with the shared memory segment. This sounds to me like an added feature of your Un*x. The ability to have a "temporary" shared memory segment would be great but I don't think standard System V R3 provides this. Jay Logue =============================================================================== Retix USMail: 2644 30th Street, Santa Monica, CA 90405-3009 U.S.A Tel: (213) 399-1611 Fax: (213) 458-2685 Telex: 4944307 E-mail: jay@retix.com X.400: C=US;ADMD=TELEMAIL;PRMD=RETIX;O=OSI ONE;S=LOGUE;G=JAY ===============================================================================