1.7.0 sem_open

Corinna Vinschen corinna-cygwin@cygwin.com
Sat Jun 13 02:21:00 GMT 2009


On Jun 12 15:56, Pedro Izecksohn wrote:
>   Corinna Vinschen read my mind.
> 
> > What is semtool?
> 
> semtool - A utility for tinkering with semaphores
> 
> USAGE:  semtool  (c)reate <semcount>
>                  (l)ock <sem #>
>                  (u)nlock <sem #>
>                  (d)elete
>                  (m)ode <mode>
> 
>   It comes in some package available through the Cygwin's installer. I

Uh, cygutils.  I didn't know that.

> do not understand how to use it.

It is unrealted to what you're doing.  It uses XSI semaphores which
require a running cygserver process.  See the User's Guide.  Your
example code is using POSIX sempahores.

> >>   I wrote an example that works on Jaunty on x86-64 but not on Cygwin:
> >> http://www.izecksohn.com/pedro/c/semaphores/semaphores.tar.gz
> >
> > Works for me.
> 
>   The persistence of the semaphore also works for you?
> 
>   For me, using the unpatched version, (not the CVS version), the
> persistence works some times only. At other times the semaphore
> disappears with the Control c.

The semaphore is backed by a file on disk.  If you don't call
sem_unlink one way or the other, the semaphore persists.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list