Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list POSIX semaphores on Mac OS X

How can I list the POSIX named semaphores which belong to a specific process on Mac OS X?

I know the ipcs -s command but it seems to list the System V semaphores, which I guess is different from the POSIX one since I don't recognize my own named semaphores.

I use the sem_open / sem_close / sem_wait functions.

Is there any way to list the "handles" belong to a specific process, something like the Process Explorer on the Windows platform?

like image 800
Gabor Forgacs Avatar asked Jul 09 '12 10:07

Gabor Forgacs


1 Answers

You can do lsof -p <pid> | grep PSXSEM. lsof may be more reliable when run privileged, you may wish to use sudo lsof ....

like image 178
Ken Thomases Avatar answered Nov 12 '22 15:11

Ken Thomases