Re: Posix shared memory problem

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;
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

Jilles Tjoelker
freebsd-arch@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"