Reputation:
A named semaphore(using semaphore.h
) is identified by a name of the form /somename;
that is, a null-terminated string of up to NAME_MAX-4 (i.e., 251) characters consisting of an initial slash, followed by one or more characters, none of which are slashes.
As the name corresponds to pathname in filesystem. Where this semaphore is located?
ipcs -s not showing named semaphore as ipcs is for System V semaphores.How to locate POSIX semaphores?
Upvotes: 4
Views: 3131
Reputation: 30790
From the sem_overview
man page:
On Linux, named semaphores are created in a virtual filesystem, normally mounted under
/dev/shm
, with names of the formsem.somename
. (This is the reason that semaphore names are limited toNAME_MAX-4
rather thanNAME_MAX
characters.)
Do not expect this detail to be remotely similar on non-Linux systems (in fact, don't even expect semaphores to be visible by any means other than sem_open()
).
Upvotes: 6