This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Bug in sem_getvalue


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]