RTEMS ITRON 3.0 API User's Guide
ER preq_sem( ID semid );
E_OK - Normal Completion
E_ID - Invalid ID number (semid was invalid or could not be used)
E_NOEXS - Object does not exist (the semaphore specified by semid
does not exist)
E_OACV - Object access violation (A semid less than -4 was
specified from a user task. This is implementation dependent.)
E_TMOUT - Polling failure or timeout exceeded
E_CTX - Context error (issued from task-independent portions or a
task in dispatch disabled state)
EN_OBJNO - An object number which could not be accessed on the
target node is specified.
EN_PAR - A value outside the range supported by the target node
and/or transmission packet format was specified as a parameter (a value
outside supported range was specified for tmout)
This routine attempts to acquire the semaphore specified by semid.
If the semaphore is available (i.e. positive semaphore count), then the
semaphore count is decremented and the calling task returns immediately.
Otherwise, the E_TMOUT error is returned to the calling task to
indicate the semaphore is unavailable.
Multiprocessing is not supported. Thus none of the "EN_" status codes will be returned.
This routine will not cause the running task to be preempted.
RTEMS ITRON 3.0 API User's Guide
Copyright © 1988-2004 OAR Corporation