From owner-freebsd-hackers Wed Feb 4 09:54:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA29252 for hackers-outgoing; Wed, 4 Feb 1998 09:54:01 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from po1.bbn.com (PO1.BBN.COM [192.1.50.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA29091 for ; Wed, 4 Feb 1998 09:53:51 -0800 (PST) (envelope-from dennis@bbn.com) Received: from bbn.com (DROCKWELL.BBN.COM [128.89.31.139]) by po1.bbn.com (8.8.6/8.8.6) with ESMTP id MAA23195 for ; Wed, 4 Feb 1998 12:52:36 -0500 (EST) Message-Id: <199802041752.MAA23195@po1.bbn.com> To: "hackers@FreeBSD.ORG" Subject: Re: Shared memory and signals In-reply-to: Message from Michael Schuster <34D8136F.CF845A68@utimaco.co.at> . X-face: &R'hN{mZu#r@8b_JU\bn"!fYpP{?5k4p/(|]?.2'6;>Dc9}~t*vY=/#-:"63ya.%)%o`Kv$ u&'Ff5k&n[}QC;j7YYsR5Hl]G"E:*9Zmw;dx[sw&9Tmx_PB/7B`RdFW;#@49hJU&kW+J"<[`9^?.dQ 3]L$zK,4'=tThX$wC!M\`e*@1y Date: Wed, 04 Feb 1998 12:53:43 -0500 From: Dennis Rockwell Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" On 4 Feb, Michael Schuster wrote: > You probably wouldn't want to do that, since shmctl(IPC_RMID,..) really > removes the shm segment, and other processes trying to use it wouldn't > be very happy about that ... > You could find out about the number of attached processes/threads using > something like: > > int fd; > struct shmid_ds sInfo; > > shmctl (fd, IPC_STAT, &sInfo); > > if (sInfo.shm_nattch > 1) > shmctl (fd, IPC_RMID, NULL); Isn't this backwards? (nattach <= 1) Also, this looks like a race condition just waiting to be lost. Dennis Rockwell dennis@bbn.com GTE Internetworking BBN Technologies +1-617-873-5745 Cambridge, MA +1-617-873-6091 (Fax)