Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

272 Chapter9
Intrinsics Reference (cont)
IOWAIT
IOWAIT
Initiates completion operations for an I/O request. Delays program
processing until an I/O operation completes.
Syntax
I16 I16V UDS I16 U16
fnum
:=IOWAIT(filenum,
buffer
,
length
,
cstation
);
Use
The IOWAIT intrinsic initiates completion operations for an I/O request
and suspends the calling process until some I/O completes.
A call to either IOWAIT or its companion intrinsic, IODONTWAIT,
must follow every read or write request posted against a file that was
opened with NOWAIT I/O specified in the FOPEN or HPFOPEN call.
(The process must have been running in privileged mode for NOWAIT
I/O to have been specified.)
When NOWAIT I/O is used the parameters associated with the
IODONTWAIT or IOWAIT call receive the values that normally would
have been returned in the read or write request. See the parameter
explanations that follow for what these values represent.
If you call IOWAIT and no I/O has completed, the calling process is
suspended until some I/O completes.
If you call IODONTWAIT and no I/O has completed, control is returned
to the calling process, CCE is returned, and the result of IODONTWAIT
is zero.
Functional Return
fnum 16-bit signed integer (assigned functional
return)
The file number for which the completion occurred. If
no completion occurred, zero is returned.
Parameters
filenum 16-bit signed integer by value (required)
The file number for which there is a pending I/O
request. If you specify 0, the IOWAIT intrinsic checks
for any I/O completion.
buffer user-defined structure (optional)