HP OpenVMS Systems Documentation

Content starts here

OpenVMS I/O User's Reference Manual


Previous Contents Index


PTD$DELETE

Forces the pseudoterminal to be deleted and frees the channel.

Format

PTD$DELETE chan


RETURNS


OpenVMS usage: longword (unsigned)
type: write only
access: by value


Arguments

chan


OpenVMS usage: channel
type: word (unsigned)
access: read only
mechanism: by value

Number of the I/O channel assigned to the pseudoterminal. This channelis only intended to be used for PTD$XXX operations.

Description

PTD$DELETE forces the pseudoterminal to be deleted and frees thechannel assigned to the pseudoterminal. When a pseudoterminal isdeleted, any process using the pseudoterminal (except the controlprogram) is disconnected. A PTD$DELETE request causes any pending I/Ofor the control program to be aborted. It deletes any queued eventnotification ASTs and returns the I/O buffers back to the application.It also causes the pseudoterminal unit control block (UCB) to bedeleted once the reference count returns to zero.

Return Values

SS$_NORMAL Normal successful completion.
SS$_DEVOFFLINE Device is off line and request cannot proceed.
SS$_IVCHAN Illegal channel.
SS$_NOPRIV Insufficient privilege to perform request.

PTD$READ

Reads data from the pseudoterminal. The PTD$READ routine completesasynchronously; that is, it returns to the caller without waiting forthe data to be read.

For synchronous completion, use the PTD$READW routine. The PTD$READWroutine is identical to the PTD$READ routine in every way, except thatPTD$READW returns to the caller after the data is read.


Format

PTD$READ [efn], chan [,astadr] [,astprm] readbuf, readbuf_len


RETURNS


OpenVMS usage: longword (unsigned)
type: write only
access: by value


Arguments

efn


OpenVMS usage: ef_number
type: longword (unsigned)
access: read only
mechanism: by value

Number of the event flag to be set when PTD$READ returns the requestedinformation. If you do not specify this argument, event flag 0 is used.When PTD$READ begins execution, it clears this flag.

chan


OpenVMS usage: channel
type: word (unsigned)
access: read only
mechanism: by value

Number of the I/O channel assigned to the pseudoterminal. This channelis only intended to be used for PTD$XXX operations.

astadr


OpenVMS usage: ast_procedure
type: procedure value
access: call without stack unwinding
mechanism: by reference

AST service routine to be executed when PTD$READ completes. If youspecify astadr, the AST routine executes at the sameaccess mode as the caller of the PTD$READ routine.

astprm


OpenVMS usage: user_arg
type: longword (unsigned)
access: read only
mechanism: by value

AST parameter to be passed to the AST service routine specified by theastadr argument.

readbuf


OpenVMS usage: char_string
type: character coded text string
access: write only
mechanism: by reference

Address of the read I/O status longword. The first character positionin an I/O buffer to receive all output is this address plus 4. Thereadbuf argument must be in the range specified in theinadr argument of the PTD$CREATE routine, otherwise anSS$_ACCVIO status is returned.

readbuf_len


OpenVMS usage: word_unsigned
type: word (unsigned)
access: read only
mechanism: by value

Number of characters that can be read from the pseudoterminal andstored in the buffer specified by readbuf.

Description

The PTD$READ routine reads data from the pseudoterminal. The readrequest completes with a minimum of one character and a maximum of thenumber of characters specified by the readbuf_lenargument. The read operation completes when the pseudoterminal hascharacters to output. If a read request is issued and no data isavailable, the read request is queued and then completed at a latertime.

Return Values

SS$_NORMAL Normal successful completion.
SS$_ACCVIO Unable to read an argument, or invalid read buffer address.
SS$_DEVOFFLINE Device is off line and request cannot proceed.
SS$_EXASTLM Insufficient AST quota for notification AST.
SS$_ILLEFC Illegal event flag cluster.
SS$_INSFMEM Insufficient memory.
SS$_IVBUFLEN Buffer size supplied is illegal.
SS$_IVCHAN Illegal channel.
SS$_NOPRIV Insufficient privilege to perform request.
SS$_UNASEFC Unassociated event flag cluster.

PTD$READW

Reads data from the pseudoterminal. The PTD$READW routine completessynchronously; that is, it returns to the caller after the data hasbeen read.

For asynchronous completion, use the PTD$READ routine. The PTD$READroutine is identical to the PTD$READW routine in every way except thatPTD$READ returns to the caller without waiting for the data to be read.


Format

PTD$READW [efn], chan [,astadr] [,astprm] readbuf, readbuf_len


PTD$SET_EVENT_NOTIFICATION

Enables or disables a number of repeating terminal event notificationASTs.

Format

PTD$SET_EVENT_NOTIFICATION chan, astadr [,astprm] [,acmode], type


RETURNS


OpenVMS usage: longword (unsigned)
type: write only
access: by value


Arguments

chan


OpenVMS usage: channel
type: word (unsigned)
access: read only
mechanism: by value

Number of the I/O channel assigned to the pseudoterminal. This channelis only intended to be used for PTD$XXX operations.

astadr


OpenVMS usage: ast_procedure
type: procedure value
access: call without stack unwinding
mechanism: by reference

Address of the notification AST service routine, or zero if the AST isto be canceled.

astprm


OpenVMS usage: user_arg
type: longword (unsigned)
access: read only
mechanism: by value

AST parameter to be passed to the AST service routine specified by theastadr argument.

acmode


OpenVMS usage: access_mode
type: longword (unsigned)
access: read only
mechanism: by value

Access mode for which the AST is to be declared. The most privilegedaccess mode is the access mode of the caller. The resulting mode is theaccess mode at which the AST is declared.

type


OpenVMS usage: type_longword
type: longword (unsigned)
access: read only
mechanism: by value

Value that indicates which notification AST to enable. The $PTDDEFmacro defines the symbolic names listed in Table D-2.

Table D-2 Symbolic Names Defined by$PTDDEF Macro
Symbolic Name Description
PTD$C_SEND_XON Deliver notification AST when the pseudoterminal is ready to accept input. This AST is not delivered if the pseudoterminal is set to NO HOSTSYNC.
PTD$C_SEND_BELL Deliver notification AST when the pseudoterminal wants to stop input and signal it with a bell character.
PTD$C_SEND_XOFF Deliver notification AST when the pseudoterminal wants to stop input and signal it with a DC3 character.
PTD$C_STOP_OUTPUT Deliver notification AST when the pseudoterminal is stopping output.
PTD$C_RESUME_OUTPUT Deliver notification AST when the pseudoterminal is resuming output.
PTD$C_CHAR_CHANGED Deliver notification AST when the pseudoterminal has changed some device characteristic.
PTD$C_ABORT_OUTPUT Deliver notification AST when the pseudoterminal wants to abort output.
PTD$C_START_READ Deliver notification AST when the pseudoterminal is starting an application's read request. This AST is delivered only if read event notification has been enabled.
PTD$C_MIDDLE_READ Deliver notification AST when the pseudoterminal has finished sending an application's read request prompt string. This AST is delivered only if read event notification has been enabled.
PTD$C_END_READ Deliver notification AST when the pseudoterminal has finished an application's read request. This AST is delivered only if read event notification has been enabled.
PTD$C_ENABLE_READ Enable terminal read event AST delivery. If this code is used, you cannot supply the astadr argument.
PTD$C_DISABLE_READ Disable terminal read event AST delivery. If this code is used, you cannot supply the astadr argument.

Description

PTD$SET_EVENT_NOTIFICATION enables or disables the repeating terminalevent notification ASTs listed in Table D-2. After an eventnotification AST is enabled, it remains in effect until it is disabledor until the device is deleted.

Return Values

SS$_NORMAL Normal successful completion.
SS$_ACCVIO Unable to read an argument, or invalid I/O buffer address.
SS$_BADPARAM An astadr, astprm, or acmode argument was not zero when enabling or disabling read notification.
SS$_DEVOFFLINE Device is off line and request cannot proceed.
SS$_EXASTLM Insufficient AST quota for notification AST.
SS$_INSFMEM Insufficient memory.
SS$_IVCHAN Illegal channel.
SS$_NOPRIV Insufficient privilege to perform request.

PTD$WRITE

Inputs data to the pseudoterminal and reads any immediately echoedcharacters.

Format

PTD$WRITE chan [,astadr] [,astprm], wrtbuf, wrtbuf_len [,echobuf][,echobuf_len]


RETURNS


OpenVMS usage: longword (unsigned)
type: write only
access: by value


Arguments

chan


OpenVMS usage: channel
type: word (unsigned)
access: read only
mechanism: by value

Number of I/O channel assigned to the pseudoterminal. This channel isonly intended to be used for PTD$XXX operations.

astadr


OpenVMS usage: ast_procedure
type: procedure value
access: call without stack unwinding
mechanism: by reference

AST service routine to be executed when PTD$WRITE completes. Ifastadr is specified, the AST routine executes at thesame access mode as the caller of the PTD$WRITE routine.

astprm


OpenVMS usage: user_arg
type: longword (unsigned)
access: read only
mechanism: by value

AST parameter to be passed to the AST service routine specified by theastadr argument.

wrtbuf


OpenVMS usage: char_string
type: character coded text string
access: read only
mechanism: by reference

Address of the write I/O status longword. The first character in an I/Obuffer to be written is this address plus 4. Thewrtbuf must be in the range specified by theinadr argument of the PTD$CREATE routine; otherwise anSS$_ACCVIO status is returned.

wrtbuf_len


OpenVMS usage: word_unsigned
type: word (unsigned)
access: read only
mechanism: by value

Number of characters to be written to the pseudoterminal. Thesecharacters appear as input to the terminal side of the pseudoterminal.

echobuf


OpenVMS usage: char_string
type: character coded text string
access: write only
mechanism: by reference

Address of the echo I/O status longword. The first character positionin an I/O buffer to receive all output is this address plus 4. Theechobuf must be in the range specified by theinadr argument of the PTD$CREATE routine; otherwise anSS$_ACCVIO status is returned.

echobuf_len


OpenVMS usage: word_unsigned
type: word (unsigned)
access: read only
mechanism: by value

Number of characters that can be read from the pseudoterminal. If anecho buffer is specified, up to echobuf_len characterscan be stored in it.

Description

PTD$WRITE inputs data to the pseudoterminal and reads any immediatelyechoed characters. PTD$WRITE allows you to specify a buffer to receiveany output generated by the write; you do not need to issue a separateread request to read this data.

Return Values

SS$_NORMAL Normal successful completion.
SS$_ACCVIO Unable to read an argument, or invalid I/O buffer address.
SS$_DATALOST The terminal driver type-ahead buffer is full and character written was lost.
SS$_DATAOVERUN The terminal driver type-ahead buffer is getting full; attempts to send more data might result in loss of characters.
SS$_DEVOFFLINE Device is off line and request cannot proceed.
SS$_EXASTLM Insufficient AST quota for notification AST.
SS$_INSFMEM Insufficient memory.
SS$_IVBUFLEN Buffer size supplied is illegal.
SS$_IVCHAN Illegal channel.
SS$_NOPRIV Insufficient privilege to perform request.


Index Contents