Re: getting permission denied with shmat() as non-root
On Sat, 2011-08-27 at 20:44 -0400, Timothy Stotts wrote:
> I am using ftok(), shmget(), shmat() to obtain a small quantity of
> shared memory for the application. As root, the shmat() function
> succeeds on the embedded system. However, on the Debian system the
> shmat() function returns -1 with an error code of EACCES, indicating
> permission denied.
This means that the shared memory exists, or you would get EINVAL.
The ipcs command may be used to list information about shared memory,
and other ipc facilities. Try using ipcs(1) to see if there is a an
owner and/or permissions mismatch for the shmid you are using.
Peter Miller <email@example.com>