HP OpenVMS I/O User’s Reference Manual: OpenVMS Version 8.4 > Appendix D Control Connection Routines

D.2 PTD$CREATE — Create a Pseudoterminal

Creates a new pseudoterminal with a unique device name.

D.2.1 Format

PTD$CREATE chan [,acmode] [,charbuff] [,bufflen] [,astadr] [,astprm]
            [,ast_acmode], inadr

D.2.2 Returns

OpenVMS usage:

cond_value

type:

longword (unsigned)

access:

write only

mechanism:

by value

D.2.3 Arguments

chan

OpenVMS usage:

channel

type:

word (unsigned)

access:

write only

mechanism:

by value

Number of the channel that is assigned to the new pseudoterminal. This argument is the address of a word into which PTD$CREATE writes the channel number. This channel is only intended to be used for PTD$XXX operations.

acmode

OpenVMS usage:

access_mode

type:

longword (unsigned)

access:

read only

mechanism:

by value

Access mode to be associated with the channel. The most privileged access mode is the access mode of the caller. I/O operations on the channel can be performed only from equal and more privileged access modes.

charbuff

OpenVMS usage:

device_characteristics

type:

longword (unsigned)

access:

read only

mechanism:

by reference

Address of buffer containing the device characteristics. This information is used to set up the pseudoterminal's initial characteristics. This buffer can be 12, 16, or 20 bytes long.

Figure D-1 shows the format of this buffer:

Figure D-1 Device Characteristics Buffer

Device Characteristics Buffer

bufflen

OpenVMS usage:

word_unsigned

type:

word (unsigned)

access:

read only

mechanism:

by value

Length of the characteristics buffer (either 12, 16, or 20 bytes). This argument is required if you supply the charbuff argument.

astadr

OpenVMS usage:

ast_procedure

type:

procedure value

access:

call without stack unwinding

mechanism:

by reference

AST service routine to be executed when the terminal connection deassigns the last channel to the pseudoterminal. This argument is the procedure value of this routine. This is a repeating AST and is active until the control connection deletes the pseudoterminal.

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 astadr.

ast_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 privileged access mode is the access mode of the caller. The resulting mode is the access mode at which the AST is declared.

inadr

OpenVMS usage:

address_range

type:

longword (unsigned)

access:

read only

mechanism:

by reference

Address of a two-longword array containing the starting and ending virtual addresses in the virtual address space of the process (either P0 or P1 regions) to be used as I/O buffers. The array contains, in order, the starting and ending virtual addresses. The addresses supplied to inadr must express an integral number of CPU-specific pages. The lower address must be on a CPU-specific page boundary, and the higher address must be one less than a CPU-specific page boundary. Together these addresses form a range from lowest to highest bytes. The pages must already exist and must be fully contained in either P0 or P1 space. All pages in the range must:

  • Have identical page protection

  • Be writable in the mode of the caller

  • Be owned by the same access mode

  • Be owned in a mode equal to or less privileged than the caller

  • Be of the same page type (process or global)

D.2.4 Description

PTD$CREATE creates a new pseudoterminal with a unique device name. This device name is in the form FTAn:, where n is the unit number.

When a pseudoterminal is created, it inherits the current system terminal default attributes unless you specify an alternate set of characteristics.

D.2.5 Return Values

SS$_NORMAL

Normal successful completion.
SS$_ACCVIOUnable to read one of the arguments.
SS$_BADPARAMBad Parameter Value.
SS$_EXBYTLMInsufficient BYTLM to create device or map buffers.

SS$_EXQUOTA

Insufficient quota to create device.
SS$_EXASTLMInsufficient AST quota for notification AST.

SS$_INFMEM

Insufficient memory to create device.
SS$_INSFWSLInsufficient working set limit to map buffers.

SS$_IVSECFLG

Invalid process or global section flags.

SS$_NOPRIVNo privilege for attempted operation.
SS$_PAGPNWNVIO

Page owner violation.

SS$_VA_IN_USEVirtual address already in use.