SIO_reclaim
Application Program Interface
2-403
C Interface
Syntax
nmadus = SIO_reclaim(stream, pbufp, parg);
Parameters
SIO_Handle stream;
/* stream handle */
Ptr
*pbufp;
/* pointer to the buffer */
Arg
*parg;
/* pointer to a user argument */
Return Value
Int
nmadus; /* number of MADUs or error if negative */
Description
SIO_reclaim is used to request a buffer back from a stream. It returns a
pointer to the buffer, the number of valid MADUs in the buffer, and a user
argument (parg). After the SIO_reclaim call parg points to the same value
that was passed in with this buffer using the SIO_issue call.
If you want to return a frame-specific status along with the buffer, use
SIO_reclaimx instead of SIO_reclaim.
Internally, SIO_reclaim calls Dxx_reclaim, then it gets the frame from the
driver’s device->fromdevice queue.
If a stream was created in SIO_OUTPUT mode, then SIO_reclaim
returns an empty buffer, and nmadus is zero, since the buffer is empty. If
a stream was opened in SIO_INPUT mode, SIO_reclaim returns a non-
empty buffer, and nmadus is the number of valid MADUs of data in the
buffer.
If SIO_reclaim is called from a TSK thread, it blocks (in either mode) until
a buffer can be returned to the caller, or until the stream’s timeout
attribute expires (see SIO_create), and it returns a positive number or
zero (indicating success), or a negative number (indicating an error
condition). If timeout is not equal to SYS_FOREVER or 0, the task
suspension time can be up to 1 system clock tick less than timeout due
to granularity in system timekeeping.
If SIO_reclaim is called from a SWI thread, it returns an error if it is called
when no buffer is available. SIO_reclaim never blocks when called from
a SWI.
To indicate success, SIO_reclaim returns a positive value for nmadus. As
a success indicator, nmadus is the number of valid MADUs in the buffer.
To indicate failure, SIO_reclaim returns a negative value for nmadus. As
a failure indicator, nmadus is the actual error code multiplied by -1.
SIO_reclaim
Request a buffer back from a stream