From owner-freebsd-hackers Tue Feb 3 23:08:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA01628 for hackers-outgoing; Tue, 3 Feb 1998 23:08:51 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from safeconcept.utimaco.co.at (mail-gw.utimaco.co.at [195.96.28.162]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA01623 for ; Tue, 3 Feb 1998 23:08:45 -0800 (PST) (envelope-from Michael.Schuster@utimaco.co.at) Received: (from uucp@localhost) by safeconcept.utimaco.co.at (8.8.5/8.8.5) id HAA04173 for ; Wed, 4 Feb 1998 07:48:47 +0100 (CET) Received: from ultra1.utimaco.co.at(10.0.0.32) by safeconcept via smap (V2.0) id xma004171; Wed, 4 Feb 98 07:48:44 +0100 Message-ID: <34D8136F.CF845A68@utimaco.co.at> Date: Wed, 04 Feb 1998 08:06:23 +0100 From: Michael Schuster Organization: Utimaco Safe Concept GmbH. Linz Austria X-Mailer: Mozilla 4.04 [en] (X11; I; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: "hackers@FreeBSD.ORG" Subject: Re: Shared memory and signals Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" Graham Wheeler wrote: >I notice from looking at the kernel source >that it appears as if an exit() effectively does a shmdt for each shared >memory segment, but not a shmctl(IPC_RMID,..). 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); -- Michael Schuster