Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) SPT_WRITEUPDATEX(2)
Considerations
Buffer use SPT_WRITEUPDATEX() is intended for use with 32-bit extended addresses.
Therefore, the data buffer for SPT_WRITEUPDATEX() can be either in the
caller’s stack segment or any extended data segment.
I/O counts with unstructured files
Unstructured files are transparently blocked using one of the four valid block
sizes (512, 1024, 2048, or 4096 bytes; 4096 is the default). This transparent
block size, known as BUFFERSIZE, is the transfer size used against an unstruc-
tured file. While BUFFERSIZE does not change the maximum unstructured
transfer (4096 bytes), multiple I/O operations might be performed to satisfy a
user’s request depending on the BUFFERSIZE chosen. For example, if BUF-
FERSIZE 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.
Because the maximum blocksize for DP2 structured files is also 4096 bytes, this
is also the maximum structured transfer size for DP2.
Deleting locked records
Deleting a locked record implicitly unlocks that record unless the file is audited,
in which case the lock is not removed until the transaction terminates.
Waited SPT_WRITEUPDATEX() calls
If a waited SPT_WRITEUPDATEX() call is executed, the count_written
parameter indicates the number of bytes actually written.
Nowait SPT_WRITEUPDATEX() calls
If a nowait SPT_WRITEUPDATEX() call is executed, count_written has no
meaning and can be omitted. The count of the number of bytes written is
obtained through the count-transferred parameter of the Guardian AWAITIOX
procedure when the I/O completes.
The SPT_WRITEUPDATEX() procedure must finish with a corresponding call
to the Guardian AWAITIOX procedure when used with a file that is opened for
nowait I/O. For files audited by the Transaction Management Facility (TMF),
the AWAITIOX procedure must be called before the
SPT_ENDTRANSACTION() or SPT_ABORTTRANSACTION() function is
called.
Do not change the contents of the data buffer between the initiation and comple-
tion of a nowait write operation. A retry can copy the data again from the user
buffer and cause the wrong data to be written. Avoid sharing a buffer between a
write and another I/O operation because the contents of the write buffer might
change before the write is completed.
Invalid write operations to queue files
Attempts to perform SPT_WRITEUPDATEX() operations are rejected with a
Guardian file-system error 2.
Disk File Considerations
Large data transfers
To enable large data transfers (more than 4096 bytes), you can use
SPT_SETMODE() function 141. See the description of SETMODE functions
in the Guardian Procedure Calls Reference Manual.
527186-023 Hewlett-Packard Company 7−461