The ttyname callable service obtains the pathname of the terminal that is associated with the file descriptor.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1TYN): | 31-bit |
AMODE (BPX4TYN): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4TYN with the same parameters.
The name of a fullword that contains the file descriptor.
The name of a fullword that contains the size, in bytes, of the buffer that is referred to by Terminal_name. The size of this field should be less than 4096 bytes (4KB) in length. The size of the buffer that is specified should be the maximum length that the terminal_name could be on output.
The name of an area to which ttyname returns either the pathname of the terminal, terminated by a X'00', or a single byte of X'00' (null string), if the file descriptor is not valid or does not represent a terminal.
The length of Terminal_name should be 1024 bytes long (PATH_MAX+1), unless the pathname is known to be shorter.
There are no restrictions on the use of the ttyname service.
For an example using this callable service, see BPX1TYN (ttyname) example.