2

I'm new to Linux IPC concepts in C. When a shared memory is created by a process. That Shm can be accessed by any other processes also. Consider the following figure,

https://i.stack.imgur.com/Z8ix5.jpg or http://s14.postimg.org/5zpgstuvl/shared.jpg

If 4 process named A,B,C,D are running on a system and a shared memory is created by A. Is there any mechanism or concept to restrict the access of shm to only A and D and disallow the access to B and C (even they have the key of the shared memory).

Here, Access means "Read only / Read-Write".

Little help is appreciated...

Thanking you.

shravan
  • 85
  • 9
  • 2
    Yes, the permissions in `shmget` (sysv) or `shm_open` (posix) – Duck Feb 19 '14 at 18:10
  • - Thanks for the reply Mr.Duck - So a user who created a shared memory for a process can create some other process to access that shared memory. Right? - If the permissions are given for the same user. Other users cannot access that memory? Isn't it? – shravan Feb 21 '14 at 10:38
  • Right. Like file permissions, access can be granted by user, group and world. – Duck Feb 21 '14 at 13:58

0 Answers0