This is the mail archive of the
mailing list for the Cygwin project.
sem_trywait returns EAGAIN (rather than returning -1 and setting errno)
- From: "Andrew T. Schnable" <schnable at enteract dot com>
- To: <cygwin at cygwin dot com>
- Date: Mon, 25 Feb 2002 21:31:41 -0500
- Subject: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)
I was doing some pthreads/semaphore work and I tracked down a
problem in my code to a bug in sem_trywait. Posix sem_trywait is defined as
returning -1 and setting errno to EAGAIN if the semaphore would have
The cygwin implementation returns EAGAIN an leaves errno unchanged.
Has anyone else encountered this problem and provided a fix?
PS. The problem seems to be in thread.cc (semaphore::TryWait) - I don't see
stderr setting anywhere in this file - is this verboten - or just
/*FIXME: signals should be able to interrupt semaphores...
*We probably need WaitForMultipleObjects here.
if (WaitForSingleObject (win32_obj_id, 0) == WAIT_TIMEOUT)
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html