Open System Services System Calls Reference Manual (G06.28+)

System Functions (s and S) SPT_WRITEX(2)
Structured files
Inserting records into relative
or entry-sequenced les
If the insertion is to a relative or entry-
sequenced le, the le must be positioned
currently through its primary key. Otherwise,
the SPT_WRITEX() call fails, and a subse-
quent call to the Guardian FILE_GETINFO_ or
FILEINFO procedure shows that Guardian le-
system error 46 (invalid key) occurred.
Current-state indicators after
an SPT_WRITEX() call
After a successful SPT_WRITEX() call, the
current-state indicators for positioning mode
and comparison length remain unchanged.
For key-sequenced les, the current position and
the current primary-key value remain
unchanged.
For relative and entry-sequenced les, the
current position is that of the record just inserted
and the current primary-key value is set to the
value of the records primary key.
Duplicate record found on insertion request
When attempting to insert a record into a key-
sequenced le, if a duplicate record is found, the
SPT_WRITEX() function returns Guardian
le-system error 10 (record already
exists) or error 71 (duplicate record). If
the operation is part of a TMF transaction, the
record is locked for the duration of the transac-
tion.
Unstructured files
DP2 BUFFERSIZE rules
DP2 unstructured les 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 le. While BUFFERSIZE does not
change the maximum unstructured transfer
(4096 bytes), multiple I/Os can be performed to
satisfy a user request depending on the BUF-
FERSIZE chosen. For example, if BUFFER-
SIZE 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 boun-
dary.
527186-005 Hewlett-Packard Company 7359