Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 1998 01:36:59 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Shared memory and signals
Message-ID:  <19980206013659.03288@follo.net>
In-Reply-To: <199802060031.RAA16316@usr02.primenet.com>; from Terry Lambert on Fri, Feb 06, 1998 at 12:31:51AM %2B0000
References:  <19980206012232.55341@follo.net> <199802060031.RAA16316@usr02.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 06, 1998 at 12:31:51AM +0000, Terry Lambert wrote:
> > > If you use an mmap'ed file instead of a SysV SHM segment, then you
> > > will get resource-tracking cleanup after the last close, like you
> > > wanted.  The file will stick around, but you can unlink it and use
> > > UNIX domain sockets to pass the descriptor between processes, if this
> > > is a problem.
> > 
> > Any particular reason not to mmap() /dev/zero?  I though that was considered
> > the way to do this, instead of unlinking.
> 
> You have to pass sockets around instead of everyone just opening
> the same file...

What I meant was that it would probably be preferable to mmap /dev/zero and
pass that descriptor around, instead of creating a file, mmaping it,
unlinking it, and pass _that_ descriptor around.  Unless there is something
I'm really missing here.

I've always used fork() to get the descriptor passed easily, anyway :-)

Eivind.



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