NAME
WaitIO -- wait for completion of an I/O request
SYNOPSIS
error = WaitIO(iORequest)
D0 A1
BYTE WaitIO(struct iorequest *);
FUNCTION
This function waits for the specified I/O request to complete, then
removes it from the replyport. If the I/O has already completed,
this function will return immediately.
This function should be used with care, as it does not return until
the I/O request completes; if the I/O never completes, this
function will never return, and your task will hang. If this
situation is a possibility, it is safer to use the wait() function.
wait() will return return when any of a specified set of signal is
received. This is how I/O timeouts can be properly handled.
WARNING
If this iorequest was "quick" or otherwise finished before this
call, this function drops though immediately, with no call to
wait(). a side effect is that the signal bit related the port may
remain set. Expect this.
When removing a known complete iorequest from a port, waitio() is the
preferred method. A simple remove() would require a disable/enable
pair!
INPUTS
iORequest - pointer to an I/O request block
RESULTS
error - zero if successful, else an error is returned
(a sign extended copy of io_Error).
SEE ALSO
doio, sendio, checkio, abortio