This section contains information on the following
pseudoterminal operations:
Creating a pseudoterminal
Canceling a request
Deleting a pseudoterminal
6.1.1 Creating a Pseudoterminal
To create a pseudoterminal, use the PTD$CREATE
routine described in Appendix D. When a pseudoterminal is created, it inherits the current system
terminal default attributes unless you specify an alternate set of
characteristics. In either case, you cannot use PTD$CREATE to alter
the following startup attributes:
TT$M_CRFILL is cleared.
To change this attribute, issue the SET MODE $QIO function.
TT$M_LFFILL is cleared.
To change this attribute, issue the SET MODE $QIO function.
TT$M_MODEM is cleared.
This attribute cannot be changed.
TT$M_REMOTE is cleared.
This attribute cannot be changed.
TT$M_HOSTSYNC is set.
To change this attribute, issue the SET MODE $QIO function.
TT$M_TTSYNC is set. To
change this attribute, issue the SET MODE $QIO function.
TT2$M_DMA is cleared.
To change this attribute, issue the SET MODE $QIO function. Changing
it does not alter the behavior of TTDRIVER or the pseudoterminal.
TT2$M_AUTOBAUD is cleared.
To change this attribute, issue the SET MODE $QIO function. Changing
it does not alter the behavior of TTDRIVER or the pseudoterminal.
TT2$M_FALLBACK is cleared.
To change this attribute, issue the SET MODE $QIO function.
TT2$M_HANGUP is cleared.
To change this attribute, issue the SET MODE $QIO function.
TT2$M_DCL_MAILBX is cleared.
This attribute cannot be changed.
When you create a pseudoterminal, you can specify
a repeating asynchronous system trap (AST) to be delivered when the
terminal connection is freed. This AST can be supplied only when the
pseudoterminal is created, and it cannot be deleted. A terminal is
freed when a process logs out or deassigns the last channel to the
device. The AST allows the control program to determine whether or
not a user of a pseudoterminal is using it. At this point, the control
program can reuse or delete the pseudoterminal by deassigning the
control channel.
6.1.2 Canceling a Request
To cancel a queued control connection request,
the control program uses the PTD$CANCEL routine. This routine enables
the pseudoterminal driver to differentiate between control requests
and terminal requests that are being canceled. This routine cannot
be used to flush event notification ASTs.
6.1.3 Deleting a Pseudoterminal
To delete the pseudoterminal, the control program
uses the PTD$DELETE routine. When a pseudoterminal is deleted, any
process that is using the pseudoterminal (except the control process)
is disconnected. If you have the TT2$M_DISCONNECT bit set in the default
terminal characteristics parameter (TTY_DEFCHAR2) and virtual terminals
have been enabled (see “SET HOST Facility and Output Buffering”), you get a virtual terminal upon
logging in to a pseudoterminal. In this case, the process is not logged
out, but the virtual terminal is disconnected from the pseudoterminal.
The PTD$DELETE request causes any pending I/O
for the control program to be aborted. It deletes any queued event
notification ASTs and returns the I/O buffers to the application.
It also causes the pseudoterminal unit control block (UCB) to be deleted
once the reference count returns to zero.
NOTE: If an application exits without calling PTD$DELETE,
the pseudoterminal is still deleted.