RE: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-03-04 Thread Gerald S. Williams
Andrew T. Schnable [mailto:[EMAIL PROTECTED]] wrote: > I think all the sem_* functions are broken similarly. [ ... ] I just came across this myself while working on enabling Cygwin Python threads. You may find the following function helpful: static int fix_status(int status) { return (st

RE: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-28 Thread Robert Collins
> -Original Message- > From: Andrew T. Schnable [mailto:[EMAIL PROTECTED]] > returning -1 and setting errno) > > > I think all the sem_* functions are broken similarly. I have > the threads.cc file modified > and was going to try and submit patches, but I am having some > issues g

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-28 Thread Andrew T. Schnable
> To: <[EMAIL PROTECTED]> Cc: "Andrew T. Schnable" <[EMAIL PROTECTED]> Sent: Thursday, February 28, 2002 8:55 AM Subject: RE: sem_trywait returns EAGAIN (rather than returning -1 and setting errno) FWIW, I've patched sem_trywait and sem_wait. I haven't looked

RE: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-28 Thread Robert Collins
FWIW, I've patched sem_trywait and sem_wait. I haven't looked for further cases of misbehaviour though. Rob > -Original Message- > From: Christopher Faylor [mailto:[EMAIL PROTECTED]] > As Robert indicated, in the vast majority of those cases, > this was, in fact, the right thing to d

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Andrew T. Schnable
cool - I misunderstood. I will try and work up a patch... Andy - Original Message - From: "Christopher Faylor" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 7:33 PM Subject: Re: sem_trywait returns EAGAIN (rather than returnin

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Christopher Faylor
On Tue, Feb 26, 2002 at 07:14:35PM -0500, Andrew T. Schnable wrote: >You have a point regarding errno, but unfortunately, this is how the >standard >is written. If it's intentional that cygwin deviate from posix 1.b, I'm fine >with that - I can code accordingly. FYI - I went to the > >The Ope

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Andrew T. Schnable
lt;[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 5:19 PM Subject: Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno) > On Wed, Feb 27, 2002 at 09:08:54AM +1100, Robert Collins wrote: > > > > > >> -Original M

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Christopher Faylor
On Wed, Feb 27, 2002 at 09:08:54AM +1100, Robert Collins wrote: > > >> -Original Message- >> From: Christopher Faylor [mailto:[EMAIL PROTECTED]] > >> On Tue, Feb 26, 2002 at 08:37:35PM +1100, Robert Collins wrote: >> >The problem should _not_ be endemic in the pthreads code, as >> I rewr

RE: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Robert Collins
> -Original Message- > From: Christopher Faylor [mailto:[EMAIL PROTECTED]] > On Tue, Feb 26, 2002 at 08:37:35PM +1100, Robert Collins wrote: > >The problem should _not_ be endemic in the pthreads code, as > I rewrote > >nearly all the pthread* functions from the P1003.1 draft spec. >

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Christopher Faylor
On Tue, Feb 26, 2002 at 08:37:35PM +1100, Robert Collins wrote: >The problem should _not_ be endemic in the pthreads code, as I rewrote >nearly all the pthread* functions from the P1003.1 draft spec. % grep 'return E' thread.cc return ETIMEDOUT; return EAGAIN; return EFAULT; ret

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-26 Thread Robert Collins
tions from the P1003.1 draft spec. Rob === - Original Message - From: "Christopher Faylor" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 26, 2002 5:13 PM Subject: Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno) >

Re: sem_trywait returns EAGAIN (rather than returning -1 and setting errno)

2002-02-25 Thread Christopher Faylor
On Mon, Feb 25, 2002 at 09:31:41PM -0500, Andrew T. Schnable wrote: >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 >blocked. The cygw