Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 34
Monitoring Writes to a Disk File
Using the CONTROL 27 Operation
To find out whether a write operation might have taken place, you issue the
CONTROL 27 operation against a file number that is open for nowait I/O. When a
write occurs against any open on this file, the corresponding call to the AWAITIO
procedure returns. Note that adding a record to the file is not the only reason why the
CONTROL operation might finish; for example, a write operation that occurs as a result
of a backing out a transaction will also complete the CONTROL operation.
Figure 5-5 shows how CONTROL operation 27 is typically used.
The following sequence explains how the example in Figure 5-5 works:
1. The first FILE_OPEN_ call opens the file for nowait I/O, with a sync-depth of 0.
2. The second FILE_OPEN_ call opens the file again, this time for waited I/O.
3. The CONTROL 27 operation is issued against the file number returned by the
nowait open; the CONTROL operation returns immediately.
Figure 5-5. Monitoring Write Operations on a Disk File
VST124.VSD