ipcs不显示我的共享内存和旗语。

问题描述 投票:4回答:2

我用适当的标志打开了共享内存和semaphores。

sem = sem_open("/some_name", O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO, 1);
shm = shm_open("/other_name", O_RDWR | O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO);

O_EXCL, S_IRWXU forkexecO_CREAT

当我使用 ipcs 命令,但我没有看到共享内存和旗语。为什么会这样?如果它们没有出现在 ipcs,我在哪里可以检查他们?


在我的 ipcs 我在Semaphore Array列表中没有任何条目,共享内存中的条目与skype、firefox和plugin-container(firefox的)有关。我用

grep shmid /proc/*/maps     # observe pid
readlink /proc/pid/exe
c linux shared-memory ipcs
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.