The tcsetcp callable service sets the terminal session code page names to the specified values.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1TSC): | 31-bit |
AMODE (BPX4TSC): | 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 BPX4TSC with the same parameters.
The name of a fullword that contains the file descriptor of the terminal for which the code page names are to be set.
The name of the fullword that contains the length of the Termcp_structure. The Termcp_structure is mapped by BPXYTCCP, and has a length of TCCP#LENGTH. See BPXYTCCP — Map the terminal control code page structure.
The name of an area that contains the code page information to be set. This structure contains the source (ASCII) code page name, target (EBCDIC) code page name, and control flags. The Termcp_structure is mapped by the BPXYTCCP macro (see BPXYTCCP — Map the terminal control code page structure).
The name of a fullword in which the tcsetcp 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 | One of the parameters contains a value that is not correct. Consult Reason_Code returned to determine the exact reason the error occurred. |
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. |
ENODEV | One of the following error conditions exists:
|
ENOTTY | The file that is associated with the file descriptor is not a terminal device. |
The name of a fullword in which the tcsetcp service stores the reason code. The tcsetcp 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.
The tcsetcp callable service is used with terminal devices that support the forward code page names only CPCN capability. Use the tcgetcp (BPX1TGC, BPX4TGC) callable service to determine the terminal device CPCN capability.
During its processing of the tcsetcp service, the pty device driver applies the new code page names once the pty outbound data queue is drained. When this occurs, the pty input data queue is also flushed, and a TIOCXPKT_CHCP packet exception event is generated (if extended packet mode is enabled) to notify the master pty application that the code page names have been changed. The master pty application can then use the tcgetcp (BPX1TGC, BPX4TGC) callable service to retrieve the new code page names and establish the new data conversion environment.
The tcsetcp service is supported by both the master and slave pty device drivers. However, CPCN functions must first be enabled by the application that uses the master pty; enabling CPCN functions is performed by the system during the initial tcsetcp invocation against the master pty device. When the tcsetcp invocation is performed against the master pty it may be subsequently issued against the slave pty.
SIGTTOU processing | Expected behavior |
---|---|
Default or signal handler | The SIGTTOU signal is generated. |
Ignored or blocked | The SIGTTOU signal is not sent. |
The tcsetcp service is supported by the pseudoterminal device driver.
For an example using this callable service, see BPX1TSC (tcsetcp) example.