Open System Services System Calls Reference Manual (G06.28+)

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 le that is opened nowait.
It is possible to initiate concurrent nowait read operations that share the same
data buffer. To do this successfully with les opened by SPT_FILE_OPEN_(),
you must use SPT_SETMODE() function 72 to cause the system to use an
intermediate buffer in the process le 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 le, but the lenum of the locked le differs from the lenum 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 le or record.
A deadlock condition occurs if a call to SPT_READX() is made by a process
having multiple opens on the same le and the lenum used to lock the le
differs from the lenum 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
le or record is locked through a Guardian le number other than that supplied in
the call, the call is rejected with Guardian le-system error 73 (file is
locked).
Locking mode for read
The locking mode is specied by SPT_SETMODE() function 4. If you
encounter Guardian le-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 indenitely (for example, until another SPT_SETMODE() call is
performed or the le is closed), and there is no additional overhead 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 is 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 applications
responsibility to ensure this.
527186-005 Hewlett-Packard Company 7253