Re: sem_open/sem_unlink errors



On Jan 20, 10:40 am, "Maxim Yegorushkin" <maxim.yegorush...@xxxxxxxxx>
wrote:
psp wrote:
I'm using named semaphores to share them acriss processes. Parent
process opens and initializes them while child processes simply open
them.
Once in a while the sem_open call in the parent fails because I've a
OCREAT&O_EXCL flag. However, if I remove the O_EXCL flag it works. I
know this error occurs because it means this semaphore already exists,
but when I do a ipcs from command line I don't see any semaphores.Are you sure that ipcs can show you POSIX semaphores?

man ipcs

ipcs - report XSI interprocess communication facilities status
...

POSIX ipc have names in the filesystem. XSI ipc do not, this seem to be
the reason why ipcs command exists.

FWIW, named semaphores appear in the devshm file system under linux 2.6
(ls -l /dev/shm - ymmv).

--
Pierre

.