Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Feb 1998 08:06:23 +0100
From:      Michael Schuster <Michael.Schuster@utimaco.co.at>
To:        "hackers@FreeBSD.ORG" <hackers@FreeBSD.ORG>
Subject:   Re: Shared memory and signals
Message-ID:  <34D8136F.CF845A68@utimaco.co.at>

next in thread | raw e-mail | index | archive | help
Graham Wheeler <gram@cdsec.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34D8136F.CF845A68>