GDSX Manual
Design and Development
Extended General Device Support (GDSX) Manual–134303
2-87
I/O for Files Other Than $RECEIVE
An FCB is a file control block. Each file opened within GDSX, with the exception of
$RECEIVE, is assigned an FCB that is used to manage the file. Among the entries in
the FCB are the following:
For I/O for files other than $RECEIVE, the following events occur:
•
The task calls one of the pseudo Guardian procedures (for the remainder of this
discussion, the operation is assumed to be ^READ).
•
^READ allocates an IOCB (if none is available, ^READ returns with CCL and a
subsequent call to ^FILEINFO returns FENOLCB).
•
^READ stores the user’s nowait tag (if any) in iocb.histag.
•
^READ calls Guardian READ, passing $DBL(@IOCB) as the tag parameter.
•
If the read operation is successfully initiated, ^READ calls GOODEIO, which fills
out the remaining fields in the IOCB. In particular, iocb.tcbaddr is set to the address
of the TCB for the requesting task. GOODEIO also links the IOCB onto a list with
head at tcb.iocbh. Finally, the IOCB is linked through iocb.fcblink to the end of the
list with header fcb.iocbh. The state of the IOCB is changed to 1 (queued).
•
When the I/O operation completes, GDSX receives notification of this completion
by its call to AWAITIO in the dispatcher. The nowait I/O tag (tag) returned by
AWAITIO allows the dispatcher to identify the task that initiated the operation. The
IOCB is deleted from the list with head at tcb.iocbh and linked onto the end of a
iocb.bufaddrx Buffer address
iocb.rcbaddr If file is equal to 0, the address of the requester control block
associated with this request
iocb.pid If file is equal to 0, the process ID of process making this
request
fcb.file File number
fcb.error Last file management error on file
fcb.iocbh Address of first IOCB for this file
fcb.iocbt Address of last IOCB for this file
fcb.flags Open flags for file. If flags.<0> is equal to 1, this is a public open
(that is, the file is accessible to all tasks).
fcb.sync Sync depth of open
fcb.lhaddr If file is an ITC file, this is the address of the associated
LINE^HANDLER’s TCB. See discussion under “Intertask
Communication” later in this section.
fcb.owner If public file, the G-relative address where the file number is stored.
Otherwise, TCB address of opener.
fcb.type[0:4] The type (<4:9>) and subtype (<10:15>) of the associated device.