Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (R)
Guardian Procedure Calls Reference Manual522629-013
13-6
READ[X] Procedures
Nowait READ[X]
If a nowait READ[X] is executed,
count-read has no meaning and can be
omitted. The count of the number of bytes read is obtained through the
count-
transferred parameter of the AWAITIO[X] procedures when the I/O operation
completes.
The READ[X] procedure must complete with a call to the AWAITIO[X] procedure
when it is used with a file that is opened nowait. If READX is used, you must call
AWAITIOX to complete the I/O. If READ is used, you may use either AWAITIO or
AWAITIOX to complete the I/O.
It is possible to initiate concurrent nowait read operations that share the same data
buffer. To do this successfully with files opened by FILE_OPEN_, you must use
SETMODE function 72 to cause the system to use an intermediate buffer in the
process file segment (PFS) for I/O transfers. With files opened by OPEN, a PFS
buffer is used by default.
READ[X] from process files
The action for a READ of a process file is the same as that for a WRITEREAD with
zero
write-count.
READ[X] call when default locking mode is in effect
If the default locking mode is in effect when a call to READ[X] is made to a locked
file, but the
filenum of the locked file differs from the filenum in the call, the
caller of READ[X] is suspended and queued in the “locking” queue behind other
processes attempting to lock or read the file or record.
Read call when alternate locking mode is in effect
If the alternate locking mode is in effect when READ[X] is called, and the file or
record is locked through a file number other than that supplied in the call, the call is
rejected with file-system error 73 (file is locked).
Locking mode for read
The locking mode is specified by the SETMODE procedure, function 4. If you
encounter error 73 (file is locked), you do not need to call SETMODE for every
READ[X]. SETMODE stays in effect indefinitely (for example, until another
SETMODE is performed or the file is closed), and there is no additional overhead
involved.
Considerations for READX only
buffer and count-transferred can be in the user stack or in an
extended data segment.
buffer and count-transferred cannot be in the
user code space.
Note. A deadlock condition occurs if a call to READ[X] is made by a process having multiple
opens on the same file and the filenum used to lock the file differs from the filenum
supplied to READ[X].