有没有办法列出所有posix-named-semaphores,ipcs
似乎没有提供有关posix信号量的任何信息,例如ipcs -s
输出
------ Semaphore Arrays --------
key semid owner perms nsems
0xcbc384f8 32769 xxx 600 1
虽然我创建了许多posix信号量,但列出`/ dev / shm'显示了它们
-rw------- 1 xxx auniyal 16 2011-08-09 15:59 /dev/shm/sem.mysem
-rw------- 1 auniyal auniyal 16 2011-08-09 16:29 /dev/shm/sem.mysem1
答案 0 :(得分:10)
所以现在解决方案似乎是列出/dev/shm
,例如
$ ls -al /dev/shm/sem.*|more
-rw------- 1 auniyal auniyal 16 2011-08-09 15:59 /dev/shm/sem.mysem
-rw------- 1 auniyal auniyal 16 2011-08-09 16:29 /dev/shm/sem.mysem1
-rw------- 1 auniyal auniyal 16 2011-08-09 16:37 /dev/shm/sem.mysem2
-rw------- 1 auniyal auniyal 16 2011-08-09 16:37 /dev/shm/sem.mysem3
-rw------- 1 auniyal auniyal 16 2011-08-09 16:39 /dev/shm/sem.mysem4
...