Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) SPT_READX(2)
Nowait SPT_READX()
If a nowait SPT_READX( ) call is executed, count_read has no meaning and
can be omitted. The count of the number of bytes read is obtained through the
count-transferred parameter of the Guardian AWAITIOX procedure when the
I/O operation completes.
The SPT_READX() function must complete with a call to the Guardian
AWAITIOX procedure when it is used with a file that is opened for nowait I/O.
It is possible to initiate concurrent nowait read operations that share the same
data buffer. To do this successfully with files opened by SPT_FILE_OPEN_(),
you must use SPT_SETMODE() function 72 to cause the system to use an
intermediate buffer in the process file segment (PFS) for I/O transfers.
SPT_READX( ) call when default locking mode is in effect
If the default locking mode is in effect when a call to SPT_READX( ) is made to
a locked file, but the filenum of the locked file differs from the filenum in the call,
the caller of SPT_READX() is suspended and queued in the locking queue
behind other processes attempting to lock or read the file or record.
A deadlock condition occurs if a call to SPT_READX( ) is made by a process
having multiple opens on the same file and the filenum used to lock the file
differs from the filenum supplied to SPT_READX().
Read call when alternate locking mode is in effect
If the alternate locking mode is in effect when SPT_READX( ) is called, and the
file or record is locked through a Guardian file number other than that supplied in
the call, the call is rejected with Guardian file-system error 73 (file is
locked).
Locking mode for read
The locking mode is specified by SPT_SETMODE() function 4. If you
encounter Guardian file-system error 73 (file is locked), you do not need to
call SPT_SETMODE() for every call to SPT_READX(). SPT_SETMODE())
stays in effect indefinitely (for example, until another SPT_SETMODE() call is
performed or the file is closed), and no additional overhead is involved.
Location of buffer and count_read
The buffer and count transferred can be in the user stack or in an extended data
segment. The buffer and count_read cannot be in the user code space.
If the buffer and count_read are in a selectable extended data segment, the seg-
ment must be in use at the time of the call. Flat segments allocated by a process
are always accessible to the process.
Use on files opened for nowait I/O
• If the buffer is in an extended data segment, you cannot deallocate or
reduce the size of the extended data segment before the I/O completes
with a call to the Guardian AWAITIOX procedure or is canceled by a
call to the SPT_CANCEL() function or the Guardian CANCELREQ
procedure.
• You must not modify the buffer before the I/O completes with a call to
the Guardian AWAITIOX procedure. This restriction also applies to
other processes that might be sharing the segment. It is the application’s
responsibility to ensure this.
527186-023 Hewlett-Packard Company 7−
349