Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) SPT_WRITEX(2)
I/O.
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.
Disk File Considerations
Large data transfers for unstructured files using default mode
Default mode allows I/O sizes for unstructured files to be as large as 56KB
(57,344), excepting writes to audited files, if the unstructured buffer size (or
block size) is 4KB (4096). Default mode 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 4KB, DP2
automatically adjusts the unstructured buffer size to 4KB, if possible, 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
4KB is not possible. The switch to a different unstructured buffer size will have
a transient performance impact, so HP recommends that the size be initially set
to 4KB, which is the default. Transfer sizes over 4KB are not supported in
default mode for unstructured access to structured files.
Large data transfers using SPT_SETMODE(141)
You can use SPT_SETMODE() function 141 to enable large data transfers
(more than 4096 bytes) for files opened with unstructured access, regardless of
unstructured buffer size. When you use SPT_SETMODE(141) to enable large
data transfers, you can to specify up to 56K (57344) bytes for the write_count
parameter. See the description of SETMODE functions in the Guardian Pro-
cedure Calls Reference Manual.
File is locked
If you call SPT_WRITEX() is made and the file is locked through a file number
other than that supplied in the call, the call is rejected with Guardian file-system
error 73 (file is locked).
Inserting a new record into a file
The SPT_WRITEX() function inserts a new record into a file in the position
designated by the file’s primary key:
Key-sequenced files
The record is inserted in the position indicated by the value in its
primary-key field.
Queue files The record is inserted into a file at a unique location. The disk
process sets the timestamp field in the key, which causes the
record to be positioned after the other existing records that have
the same high-order user key.
If the file is audited, the record is available for read operations
when the transaction associated with the write operation com-
mits. If the transaction aborts, the record is never available to
read operations. If the file is not audited, the record is available
as soon as the write operation finishes successfully. Unlike
other key-sequenced files, a write operation to a queue file will
never encounter a Guardian file-system error 10 (duplicate
527186-023 Hewlett-Packard Company 7−479