Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (s and S) SPT_READX(2)
Use on files opened for nowait I/O
— If the buffer is in an extended data segment, you cannot deallo-
cate 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 seg-
ment. It is the application’s responsibility to ensure this.
— If the I/O has been initiated with SPT_READX( ), the I/O must
be completed with a call to the Guardian AWAITIOX procedure.
— A selectable extended data segment containing the buffer need
not be in use at the time of the call to AWAITIOX.
— You can cancel nowait I/O initiated with SPT_READX() with a
call to SPT_CANCEL() or CANCELREQ. The I/O is canceled
if the file is closed before the I/O completes or if the Guardian
AWAITIOX procedure is called with a positive time limit and
specific file number and the request times out.
Use of buffers A file opened by SPT_FILE_OPEN_() uses direct I/O transfers by
default; you can use SPT_SETMODE(72) to force the system to use an
intermediate buffer in the process file segment (PFS) for I/O transfers.
Bounds checking
If the extended address of buffer is odd, bounds checking rounds the
address to the next lower word boundary and checks an extra byte as
well. The odd address is used for the transfer.
Queue files You can use SPT_READX() to perform a nondestructive read of a
queue file record. If the Guardian KEYPOSITIONX procedure is used
to position to the beginning of the file, the first SPT_READX() call per-
formed returns a record with a length of 8 bytes and contents of all zeros.
Subsequent SPT_READX() calls return data from records written to the
file.
Disk File Considerations
Large data transfers for unstructured files using default mode
For all read procedures, using default mode allows I/O sizes for unstruc-
tured files to be as large as 56 kilobytes (57,344), if the unstructured
buffer size is 4 KB (4096). Default mode here refers to the mode of the
file if SPT_SETMODE() function 141 is not invoked.
For an unstructured file with an unstructured buffer size other than 4 KB,
DP2 automatically adjusts the unstructured buffer size to 4 KB, if possi-
ble,
when an I/O larger than 4KB is attempted. However, this adjustment is
not possible for files that have extents with an odd number of pages; in
such cases an I/O over 4 KB is not possible. The switch to a different
unstructured buffer size will have a transient performance impact, so HP
recommends that you set the size 4 KB initially, which is the default.
527186-007 Hewlett-Packard Company 7−259










