HPlogo Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 Intrinsics Reference

IODONTWAIT

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Initiates completion operations for an I/O request. Allows program processing to continue before an I/O operation completes.

Syntax

 I16             I16V    UDS    16     U16
fnum:=IODONTWAIT(filenum,buffer,length,cstation);

Use

The IODONTWAIT intrinsic initiates completion operations for an I/O request and returns control to the calling process even if no I/O has completed.

A call to either IODONTWAIT or its companion intrinsic, IOWAIT, 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 being processed. See the parameter explanations for what these values represent.

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.

If you call IOWAIT and no I/O has completed, the calling process is suspended until some I/O completes.

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 IODONTWAIT intrinsic checks for any I/O completion.

buffer

user-defined structure (optional)

Passes an input buffer. Since terminals always operate without system buffering it is not necessary for this parameter to follow a read.

length

16-bit signed integer by reference (optional)

Returns the length of the received or transmitted record. If the original request specified a byte count, the integer represents bytes. If the original request specified halfwords, the integer represents halfwords. This parameter is pertinent only if the original I/O request was a read request. The FREAD intrinsic always returns zero as its functional return if you specify NOWAIT I/O. Instead, the actual record length is returned in the length parameter of IODONTWAIT.

cstation

16-bit unsigned integer by reference (optional)

Not meaningful for asynchronous devices.

Condition Codes

CCE

Request granted. If the functional return is not zero, then I/O completion occurred with no errors. If the functional return is zero, no I/O has completed.

CCG

An end-of-file condition was encountered.

CCL

Request denied. Normal I/O completion did not occur because there were no I/O requests pending, a parameter error occurred, or an abnormal I/O completion occurred.

Special Considerations

You must be running in privileged mode to specify the NOWAIT I/O option in the FOPEN/HPFOPEN call.

Additional Discussion

See the discussion of initiating completion operations for I/O requests in Accessing Files Programmer's Guide. See also discussions of FOPEN, HPFOPEN and IOWAIT in this manual.

Feedback to webmaster