Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: "um" <dont_email@xxxxxxxxxx>
- Date: Tue, 19 Apr 2005 15:34:05 +0200
"David Schwartz" wrote
>
> "um" wrote
>
> > if ( result == -1 )
> > {
> > perror("thread: sem_trywait 1: expected error"); // No error
> > assert(errno == EAGAIN);
> >
> > It is the last assert which fails in the first of the failing test
> > programs.
>
> Why should 'perror' be expected to cause an 'EGAIN' error? You need to
> test 'errno' before calling any library functions that might change its
> value. This code is broken.
The code is not broken. In your quote you have left out the
relevant part of the code.
It is not perror which sets errno (funny imagination, btw).
errno is set by sem_trywait(). The code is:
assert((result = sem_trywait(&s)) == -1);
if ( result == -1 )
{
perror("thread: sem_trywait 1: expected error"); // No error
assert(errno == EAGAIN);
.
- Follow-Ups:
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: Doug Harrison [MVP]
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: David Schwartz
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- References:
- VC++ 2005 beta1 fails with pthreads benchmark tests
- From: um
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: Carl Daniel [VC++ MVP]
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: um
- Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- From: David Schwartz
- VC++ 2005 beta1 fails with pthreads benchmark tests
- Prev by Date: Re: memory management for
- Next by Date: RE: PRJ0019
- Previous by thread: Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- Next by thread: Re: VC++ 2005 beta1 fails with pthreads benchmark tests
- Index(es):
Relevant Pages
|