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

.



Relevant Pages

  • Re: sem_open/sem_unlink errors
    ... process opens and initializes them while child processes simply open ... Are you sure that ipcs can show you POSIX semaphores? ... ipcs - report XSI interprocess communication facilities status ...
    (comp.unix.programmer)
  • Re: Perl 5.8.6 to 5.8.7 upgrade fails IPC tests
    ... > anything that makes heavy use of SYSV IPCs... ... > Semaphores come in sets containing one or more semaphore. ... I first shut down postgres, then ran the test, and everything worked ... `n+1' trivial tasks take twice as long as `n' trivial tasks. ...
    (freebsd-questions)
  • Re: semaphores
    ... running a google search on the error message gave only one ... > result suggesting that my system was running out of semaphores. ... > `ipcs` showed that postgresql was using them and so stopping this db ... To unsubscribe, ...
    (freebsd-questions)
  • Re: semaphores and postgres
    ... > Try 'man ipcs' ... Unless I am reading something wrong, there are no semaphores being used ... nroberts@bart nroberts $ ipcs -s ... "I'm a war president. ...
    (comp.os.linux.misc)
  • Re: System V semaphore cleanup
    ... V semaphores as a file locking mechanism, ... I can use the ipcs command via the command line ...
    (comp.unix.programmer)