Date: Sun, 10 May 2009 06:49:24 +0200 From: Lothar Scholz <scholz@scriptolutions.com> To: Jilles Tjoelker <jilles@stack.nl> Cc: freebsd-arch@freebsd.org Subject: Re[2]: Posix shared memory problem Message-ID: <19461540.20090510064924@scriptolutions.com> In-Reply-To: <20090509200724.GA25714@stack.nl> References: <588815840.20090509203115@scriptolutions.com> <20090509200724.GA25714@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello Jilles,
Saturday, May 9, 2009, 10:07:24 PM, you wrote:
JT> 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.
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?
In Linux it is "/dev/shm".
In my case it looks like the directory for shm_open files has some
wrong access rights so that a normal user can't generate it.
JT> POSIX suggests making the pathname a configuration option;
JT> alternatively, using a directory for temporary files such as /tmp could
JT> work.
I will try this hack soon if nobody comes up with a solution.
--
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?19461540.20090510064924>
