Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) SPT_READLOCKX(2)
Use for key-sequenced, relative, and entry-sequenced files
For key-sequenced, relative, and entry-sequenced files, a subset of the file
(defined by the current access path, positioning mode, and comparison length) is
locked and read with successive calls to SPT_READLOCKX().
For key-sequenced, relative, and entry-sequenced files, the first call to
SPT_READLOCKX() after a positioning (or open) locks and then returns the
first record of the subset. Subsequent calls to SPT_READLOCKX() without
intermediate positioning locks returns successive records in the subset. After
each of the subset’s records are read, the position of the record just read becomes
the files current position. An attempt to read a record following the last record
in a subset returns an EOF indication.
Locking records in an unstructured file
You can use SPT_READLOCKX() to lock record positions, represented by a
relative byte address (RBA), in an unstructured file. When sequentially reading
an unstructured file with SPT_READLOCKX(), each call to
SPT_READLOCK[X() rst locks the RBA stored in the current next-record
pointer and then returns record data beginning at that pointer for read_count
bytes. After a successful call to SPT_READLOCK[X(), the current-record
pointer is set to the previous next-record pointer, and the next-record pointer is
set to the previous next-record pointer plus read_count. This process repeats for
each subsequent call to SPT_READLOCKX().
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.
Transfer size The size of the transfer is subject to current restrictions for the type of file.
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.
If you initiated the I/O with SPT_READLOCKX(), 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.
527186-023 Hewlett-Packard Company 7329