Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) SPT_WRITEX(2)
Unstructured files
DP2 BUFFERSIZE rules
DP2 unstructured files are transparently blocked using one of the
four valid DP2 blocksizes (512, 1024, 2048, or 4096 bytes; 4096
is the default). This transparent blocksize, known as BUFFER-
SIZE, is the transfer size used against an unstructured file.
While BUFFERSIZE does not change the maximum unstruc-
tured transfer (4096 bytes), multiple I/Os can be performed to
satisfy a user request depending on the BUFFERSIZE chosen.
For example, if BUFFERSIZE is 512 bytes, and a request is
made to write 4096 bytes, at least eight transfers, each 512 bytes
long, will be made. More than eight transfers happen, in this
case, if the requested transfer does not start on a BUFFERSIZE
boundary.
DP2 performance with unstructured files is best when requested
transfers begin on BUFFERSIZE boundaries and are integral
multiples of BUFFERSIZE.
If the SPT_WRITEX() call is to an unstructured disk file, data
is transferred to the record location specified by the next-record
pointer. The next-record pointer is updated to point to the record
following the record written.
Number of bytes written
If an unstructured file is created with the odd unstructured attri-
bute (also known as ODDUNSTR) set, the number of bytes writ-
ten is exactly the number specified in write_count. If the odd
unstructured attribute is not set when the file is created, the
value of write_count is rounded up to an even value before the
SPT_WRITEX() 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.
File pointers after an SPT_WRITEX() call
After a successful SPT_WRITEX() call to an unstructured file,
the file pointers have these values:
• Current-record pointer is the next-record pointer.
• Next-record pointer is the next-record pointer plus the
count written.
• End-of-file (EOF) pointer is the maximum of the EOF
pointer or the next-record pointer.
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 seg-
ment before the I/O completes with a call to the Guar-
dian AWAITIOX procedure or is canceled by a call to
the SPT_CANCEL() function or the Guardian CAN-
CELREQ procedure.
527186-023 Hewlett-Packard Company 7−481