Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 May 2009 07:57:06 +0200
From:      Lothar Scholz <scholz@scriptolutions.com>
To:        Garrett Wollman <wollman@hergotha.csail.mit.edu>
Cc:        arch@freebsd.org
Subject:   Re[4]: Posix shared memory problem
Message-ID:  <7710650619.20090510075706@scriptolutions.com>
In-Reply-To: <200905100500.n4A50GOa050728@hergotha.csail.mit.edu>
References:  <mit.lcs.mail.freebsd-arch/588815840.20090509203115@scriptolutions.com> <mit.lcs.mail.freebsd-arch/20090509200724.GA25714@stack.nl> <200905100500.n4A50GOa050728@hergotha.csail.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Garrett,

Sunday, May 10, 2009, 7:00:16 AM, you wrote:

GW> In
GW> <mit.lcs.mail.freebsd-arch/19461540.20090510064924@scriptolutions.com>
GW> scholz@scriptolutions.com writes:

>>JT> shm_open/shm_unlink refer to the filesystem; they are fairly direct
>>JT> wrappers around open and unlink.
>>
>>Question is where are they stored?

GW> In the fileststem, in the path that you specify.  They are just
GW> ordinary files.

GW> There was some thought that this was a bad (or at least
GW> not-like-Linux) way of implementing this feature, so I believe
GW> more-recent versions of FreeBSD do it differently.  When I wrote this
GW> code, I could not see any reason for the "path" argument to be
GW> interpreted differently from any other path.

Oh thats a very very bad idea.

First of all you can't use '/' if you want stay portable.
It is also just a maximum of 13 char long (says the FreeBSD 6.X man page)
and usually you now pass names like
"com.mycompany.myproduct.mypurpose" as names to prevent namespace
collisons.

The path has nothing to do with the filesystem, it's a separate
namespace. Let alone that semaphores and shared memory already use the
same namespace is something i didn't expect on Linux.

Now it is clear where my problem is and i go to a mmap to a $HOME/.
file. Not nice but if anybody gives a shit about compatibility
(backward and to other systems before implementing stuff) it is
the only way.

-- 
Best regards,
 Lothar Scholz                mailto:scholz@scriptolutions.com




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