Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 May 2009 22:07:24 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Lothar Scholz <scholz@scriptolutions.com>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Posix shared memory problem
Message-ID:  <20090509200724.GA25714@stack.nl>
In-Reply-To: <588815840.20090509203115@scriptolutions.com>
References:  <588815840.20090509203115@scriptolutions.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 09, 2009 at 08:31:15PM +0200, Lothar Scholz wrote:
> Thanks for solving the posix semaphore problem. But with shared memory
> there comes the next issue:

> int main() {
>   int m;
>   shm_unlink("/barfoo");
>   m = shm_open("/barfoo", O_RDWR|O_CREAT|O_EXCL, S_IRWXU);
>   if (m == 1) perror("shm_open error");
> }

> i always get permission denied error, and i tried many values
> for flags and mode? I can only get this working as root but not
> as a normal user.

shm_open/shm_unlink refer to the filesystem; they are fairly direct
wrappers around open and unlink.

POSIX suggests making the pathname a configuration option;
alternatively, using a directory for temporary files such as /tmp could
work.

-- 
Jilles Tjoelker



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