From owner-freebsd-hackers Mon Feb 2 07:37:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA15362 for hackers-outgoing; Mon, 2 Feb 1998 07:37:09 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from citadel.cdsec.com (citadel.cdsec.com [192.96.22.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA15353 for ; Mon, 2 Feb 1998 07:37:03 -0800 (PST) (envelope-from gram@cdsec.com) Received: (from nobody@localhost) by citadel.cdsec.com (8.8.5/8.6.9) id RAA12850 for ; Mon, 2 Feb 1998 17:42:07 +0200 (SAT) Received: by citadel via recvmail id 12810; Mon Feb 2 17:41:37 1998 From: Graham Wheeler Message-Id: <199802021541.RAA07701@cdsec.com> Subject: Shared memory and signals To: freebsd-hackers@FreeBSD.ORG Date: Mon, 2 Feb 1998 17:41:35 +0200 (SAT) X-Mailer: ELM [version 2.4 PL25-h4.1] MIME-Version: 1.0 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" Hi all I was wondering whether it is safe to call shmdt and shmctl from within a signal handler. I have a program which forks off child processes which communicate their results back using a shared memory segment. I would like the parent to detach and release the shared memory from within the SIGCHLD signal handler, but I'm not sure whether this is safe. I would also like a SIGTERM signal handler to be able to free any shared memory segments before exiting. 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,..). Does anyone know if this is safe? Thanks in advance Graham -- Dr Graham Wheeler E-mail: gram@cdsec.com Citadel Data Security Phone: +27(21)23-6065/6/7 Internet/Intranet Network Specialists Mobile: +27(83)-253-9864 Firewalls/Virtual Private Networks Fax: +27(21)24-3656 Data Security Products WWW: http://www.cdsec.com/