This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Re: Bug in sem_getvalue
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: "Woller, Thomas" <tom dot woller at cirrus dot com>
- Cc: jyl087 at netscape dot net,eCos discussion <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 08 Apr 2002 19:39:02 +0100
- Subject: Re: [ECOS] Re: Bug in sem_getvalue
- Organization: Red Hat UK Ltd.
- References: <973C11FE0E3ED41183B200508BC7774C022FBBFA@csexchange.crystal.cirrus.com>
"Woller, Thomas" wrote:
>
> The sem_getvalue() function shall update the location referenced
> by the sval argument to have the value of the semaphore
> referenced by sem without affecting the state of the semaphore.
> The updated value represents an actual semaphore value that
> occurred at some unspecified time during the call, but it need
> not be the actual value of the semaphore when it is returned to
> the calling process.
> If sem is locked, then the value returned by sem_getvalue() is
> either zero or a negative number whose absolute value represents
> the number of processes waiting for the semaphore at some
> unspecified time during the call.
> RETURN VALUE
> Upon successful completion, the sem_getvalue() function shall
> return a value of zero. Otherwise, it shall return a value of -1
> and set errno to indicate the error.
> since there is only one (1) process in eCos (only threads), does
> this mean that no matter how many threads are waiting on the
> semaphore that the value returned in the sval argument will be
> never be <-1 (e.g., -2, -3,...)?
Strictly yes. Although the change I made to eCos was to just return 0
always.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss