Guardian Procedure Calls Reference Manual

DP2 performance with unstructured files is best when requested transfers begin on
BUFFERSIZE boundaries and are integral multiples of BUFFERSIZE.
If the WRITE[X] 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.
The number of bytes written
If an unstructured file is created with the odd unstructured attribute (also known as
ODDUNSTR) set, the number of bytes written 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 WRITE[X] is executed.
You set the odd unstructured attribute with the FILE_CREATE_, FILE_CREATELIST_, or
CREATE procedure, or with the File Utility Program (FUP) SET and CREATE commands.
File pointers after WRITE[X]
After a successful WRITE[X] to an unstructured file, the file pointers have these values:
current-record pointer := next-record pointer; next-record pointer := next-record pointer
+ count written; end-of-file (EOF) pointer := max (EOF pointer, next-record pointer);
Interprocess Communication Considerations
Indication that the destination process is running
If the WRITE[X] is to another process, successful completion of the WRITE[X] (or AWAITIO[X]
if nowait) indicates that the destination process is running.
Considerations for WRITEX Only
The buffer and count transferred may be in the user stack or in an extended data segment.
The buffer and count transferred cannot be in the user code space.
If the buffer or count transferred is in a selectable extended data segment, the segment must
be in use at the time of the call. Flat segments allocated by a process are always accessible
to the process.
If the file is opened for nowait I/O, the extended segment containing the buffer need not be
in use at the time of the call to AWAITIOX.
If the file is opened for nowait I/O, and the buffer is in an extended data segment, you cannot
deallocate or reduce the size of the extended data segment before the I/O completes with a
call to AWAITIOX or is canceled by a call to CANCEL or CANCELREQ.
If the file is opened for nowait I/O, you must not modify the buffer before the I/O completes
with a call to AWAITIOX. This also applies to other processes that may be sharing the segment.
It is the application's responsibility to ensure this.
If the file is opened for nowait I/O, and the I/O has been initiated with these routines, the
I/O must be completed with a call to AWAITIOX (not AWAITIO).
Nowait I/O initiated with these routines may be canceled with a call to CANCEL or
CANCELREQ. The I/O is canceled if the file is closed before the I/O completes or AWAITIOX
is called with a positive time limit and specific file number and the request times out.
If the extended address of the buffer is odd, bounds checking rounds the address to the next
lower word boundary and checks an extra byte as well. The odd address is used for the
transfer.
WRITE[X] Procedures 1495