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

SPT_READX(2) OSS System Calls Reference Manual
Odd unstructured
If the unstructured file is created with the odd unstructured attri-
bute (also known as ODDUNSTR) set, the number of bytes read
is exactly the number of bytes specified with read_count. If the
odd unstructured attribute is not set when the file is created, the
value of read_count is rounded up to an even number before the
SPT_READX( ) operation is executed.
You set the odd unstructured attribute with the Guardian
FILE_CREATE_, FILE_CREATELIST_, or CREATE pro-
cedure, or with the File Utility Program (FUP) SET and
CREATE commands.
read_count Unstructured files are transparently blocked. The BUFFERSIZE
file attribute value, if not set by the user, defaults to 4096 bytes.
The BUFFERSIZE attribute value (which is set by specifying
SPT_SETMODE() function 93) does not constrain the allow-
able read_count in any way. However, there is a performance
penalty if the SPT_READX() call does not start on a BUFFER-
SIZE boundary and does not have a read_count that is an
integral multiple of the BUFFERSIZE. The DP2 disk process
executes your requested I/O in (possibly multiple) units of BUF-
FERSIZE blocks starting on a block boundary.
count_read for unstructured reads
After a successful call to SPT_READX() for an unstructured
file, the value returned in count_read is the minimum of
read_count or the EOF pointer minus the next-record pointer.
Pointers after an SPT_READX() call
After a successful SPT_READX( ) call to an unstructured file,
the file pointers are:
Current-record pointer is old next-record pointer.
Next-record pointer is old next-record pointer plus
count_read.
RETURN VALUES
The SPT_READX() function returns 0 (zero) upon successful completion. Otherwise, this func-
tion returns a nonzero Guardian file-system error number that indicates the outcome of the opera-
tion.
For information about Guardian file-system error numbers, see the Guardian Procedure Errors
and Messages Manual.
ERRORS
None. This function does not set the errno variable.
RELATED INFORMATION
Functions: SPT_CANCEL(2), SPT_CONTROL(2), SPT_FILE_CLOSE_(2),
SPT_FILE_OPEN_(2), SPT_LOCKFILE(2), SPT_LOCKREC(2), SPT_READLOCKX(2),
SPT_READUPDATELOCKX(2), SPT_READUPDATEX(2), SPT_SETMODE(2),
SPT_UNLOCKFILE(2), SPT_UNLOCKREC(2), SPT_WRITEREADX(2),
SPT_WRITEUPDATEUNLOCKX(2), SPT_WRITEUPDATEX(2), SPT_WRITEX(2).
7352 Hewlett-Packard Company 527186-023