GIO_flush
2-128
C Interface
Syntax
status = GIO_flush(gioChan);
Parameters
GIO_Handle gioChan; /* handle to an instance of the device */
Return Value
Int
status;
/* returns IOM_COMPLETED if successful */
Description
An application calls GIO_flush to flush the input and output channels of
the device. All input data is discarded; all pending output requests are
completed. When this call is made, all pending input calls are completed
with a status of IOM_FLUSHED, and all output calls are completed
routinely.
The gioChan parameter is the handle returned by GIO_create or
GIO_new.
This call returns IOM_COMPLETED upon successfully flushing all input
and output. If an error occurs, the device returns a negative value. For a
list of error values, see “Constants, Types, and Structures” on page 2-
118.
A call to GIO_flush results in a call to the mdSubmit function of the
associated mini-driver. The IOM_FLUSH command is passed to the
mdSubmit function. The mdSubmit call is typically a blocking call, so
calling GIO_flush can result in the thread blocking while waiting for output
calls to be completed.
Constraints and
Calling Context
❏
This function can be called only after the device has been loaded and
initialized. The handle supplied should have been obtained with a
prior call to GIO_create or GIO_new.
❏
GIO_flush cannot be called from a SWI or HWI unless the underlying
mini-driver is a non-blocking driver and the GIO Manager properties
are set to use non-blocking synchronization methods.
Example
/* Flush all I/O given to the device*/
GIO_flush(gioChan);
GIO_flush
Drain output buffers and discard any pending input