SIO_reclaim
2-404
Failure of SIO_reclaim indicates that no buffer was returned to the client.
Therefore, if SIO_reclaim fails, the client should not attempt to de-
reference pbufp, since it is not guaranteed to contain a valid buffer
pointer.
An inconsistency exists between the sizes of buffers in a stream and the
return types corresponding to these sizes. While all buffer sizes in a
stream are of type size_t, APIs that return a buffer size return a type of
Int. The inconsistency is due to a change in stream buffer sizes and the
need to retain the return type for backward compatibility. Because of this
inconsistency, it is not possible to return the correct buffer size when the
actual buffer size exceeds the size of an Int type. This issue has the
following implications:
❏
If the actual buffer size is less than/equal to the maximum
positive Int value (15 bits).
Check the return value for negative
values, which should be treated as errors. Positive values reflect the
correct size.
❏
If the actual buffer size is greater than the maximum positive Int
value.
Ignore the return value. There is little room for this situation on
’C55x large model since size_t is the same as unsigned int. Since the
sign in Int takes up one bit, the size_t type contains just one more bit
than an Int. If you are using the ’C55x huge model, size_t is 32 bits
and Int allows positive integers only up to 15 bits.
SIO_reclaim is used in conjunction with SIO_issue to operate a stream
opened in SIO_ISSUERECLAIM mode. The SIO_issue call sends a
buffer to a stream, and SIO_reclaim retrieves a buffer from a stream. In
normal operation each SIO_issue call is followed by an SIO_reclaim call.
Short bursts of multiple SIO_issue calls can be made without an
intervening SIO_reclaim call, but over the life of the stream SIO_issue
and SIO_reclaim must be called the same number of times. The number
of SIO_issue calls can exceed the number of SIO_reclaim calls by a
maximum of nbufs at any given time. The value of nbufs is determined by
the SIO_create call or by setting the Number of buffers property for the
object in the configuration.
Note:
An SIO_reclaim call should not be made without at least one
outstanding SIO_issue call. Calling SIO_reclaim with no outstanding
SIO_issue calls has undefined results.
SIO_reclaim only returns buffers that were passed in using SIO_issue. It
also returns the buffers in the same order that they were issued.