Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 24
Using FILE_COMPLETE_ and its Companion
Procedures
Using FILE_COMPLETE_ and its Companion
Procedures
The FILE_COMPLETE_ procedure and its companion procedures,
FILE_COMPLETE_SET_ and FILE_COMPLETE_GETINFO_, provide additional
capabilities for programs that use nowait I/O. They combine and enhance the function
of the AWAITIO[X] procedures and the Open System Services (OSS) select()
function. For example, you can use these procedures to complete nowait I/O on OSS
files in parallel with nowait I/O on Guardian files. You can define a particular set of files
to be “enabled” for completion and then complete outstanding I/O operations on these
files over a series of calls.
In brief, these procedures are used as follows:
The FILE_COMPLETE_SET_ procedure enables a single file or set of files for
completion by subsequent calls to the FILE_COMPLETE_ procedure. This set of
files can include both Guardian and OSS files.
The FILE_COMPLETE_GETINFO_ procedure returns information about the set of
files that are currently enabled for completion.
The FILE_COMPLETE_ procedure completes one previously initiated I/O
operation for a Guardian file or returns ready information for an OSS file. The
Guardian or OSS file is from the set of files that have been enabled for completion.
The following paragraphs explain in more detail how these procedures are used.
Using the FILE_COMPLETE_SET_ Procedure
You can use the FILE_COMPLETE_SET_ procedure to enable a single file or set of
files for completion by subsequent calls to the FILE_COMPLETE_ procedure. A file
that is “enabled for completion” is part of the set of files that the FILE_COMPLETE_
and FILE_COMPLETE_GETINFO_ procedures are aware of and can act upon; files
that are not part of this set are ignored by these procedures. You can add a file to the
enabled set only if it has been opened in a nowait manner; OSS files can be opened
blocking or nonblocking.
In a call to the FILE_COMPLETE_SET_ procedure, you can add files or remove files
from the enabled set. To do this, you pass an array of one or more
COMPLETE^ELEMENT structures to the FILE_COMPLETE_SET_ procedure. Each
structure describes a file to be added to or removed from the enabled set. Each
described file can be either a Guardian file or an OSS file.