The tcgetattr callable service sets control information for a terminal from the specified Termios_structure.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1TSA): | 31-bit |
AMODE (BPX4TSA): | 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 BPX4TSA with the same parameters.
The name of a fullword that contains the file descriptor of the terminal for which attributes are to be set.
Constant | Description |
---|---|
TCSANOW | Change the terminal attributes immediately. |
TCSADRAIN | Change the terminal attributes when all output to the terminal has been sent. |
TCSAFLUSH | Change the terminal attributes when all output to the terminal has been sent; and all input that has been received, but not read, is to be discarded. |
The name of an area that contains the attributes that are to be set. Termios_structure is mapped by the BPXYTIOS macro. This structure contains the control modes, input modes, output modes, local modes, and special control characters. For the layout of the Termios_structure, see BPXYTIOS — Map the termios structure.
The name of a fullword in which the tcsetattr service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EBADF | File_descriptor is an incorrect open file descriptor. |
EINTR | A signal interrupted the call. |
EINVAL | An action or value that was specified was incorrect. |
EIO | The process group of the process that is issuing the function is an orphaned, background process group, and the process that is issuing the function is not ignoring or blocking SIGTTOU. |
ENOTTY | The file that is associated with the file descriptor is not a terminal. |
EPERM | A change was made that is not permitted from a slave pty. See Characteristics and restrictions. |
The name of a fullword in which the tcsetattr service stores the reason code. The tcsetattr service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
MVC C_CC+VSUSP,NEWVAL To set a new value
LA R10,VSUSP To set a register to use as an index
in a later IC or STC instruction
SIGTTOU processing | Expected behavior |
---|---|
Default or signal handler | The SIGTTOU signal is generated. |
Ignored or blocked | The SIGTTOU signal is not sent. |
For an example using this callable service, see BPX1TSA (tcsetattr) example.