When I run ipcs -m, I can see a list of the shared memory segments on the system, like

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 0          user1      664        342110     0
0x00000000 32769      user1      664        28391740   5
0x00000000 65538      user1      664        1929302    4

How can I change the owner of a shared memory segment?

1 Answer 1


There is no tool do this. Only ipcrm (for deleting presented shared memory objects), ipcmk (for creating shared memory objects) and ipcs (for showing existing shared memory objects) are present (I mean util-linux project).

The kernel doesn't provide /proc interface for Sys V Shared Memory Objects instead of POSIX Shared Memory (/dev/shm/<object>).

You can write you own tool that using shmctl(2) syscall. Many tutorials and books about Unix IPC have huge count of examples about shmctl.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.