GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-44
^LISTEN
indicates the outcome of the call. The value of status is one of the following:
tcb-address input
INT .EXT:ref
is the current TCB address of the user task. See the following example for a way to
specify this address.
itc-filenum output
INT:value
is the returned ITC file number, which is an index to the FCB table where all the
information for all opened files is stored.
Example
The TCB address specified by tcb-address can be obtained by declaring and initializing
code in your user task as shown in the following example. Once the task has an ITC file
number, it uses ^READUPDATE to check for incoming ITC messages.
PROC DEVICE^HANDLER (term^file^num,
internal^term^no,
term^type);
INT .EXT my^dcb (dcb^template) := 0D;
INT .EXT my^tcb (tcb^template) := 0D;
INT itc^filenumber := 0D;
.
.
@my^dcb := dcbtbl[internal^term^no];
@my^tcb := my^dcb.tcbaddr;
error := ITC^OPENX (my^tcb, itc-filenumber)
IF itc^filenumber THEN
BEGIN
^READUPDATE (itc^filenumber);
IF = THEN
CALL ^AWAITIO (itc^filenumber, ...);
^LISTEN
This procedure looks for completed I/O operations for the calling task. Either an IOCB
address or zero is returned to the calling task.
0 An ITC file number was acquired
Nonzero Number An error condition occurred
iocb := ^LISTEN ( imsg !
i
,i-o-message !
i
,itc-flag ); !
i