Qp0zEndTerminal()--End a Generic Terminal


  Syntax
 #include <qp0ztrml.h>

 int Qp0zEndTerminal( Qp0z_Terminal_T handle, ... );  
  Service Program Name: QP0ZTRML

  Default Public Authority: *USE

  Threadsafe: Yes

The Qp0zEndTerminal() function ends the terminal session specified by handle.

The terminal session is ended by:

  1. Ending the terminal window.
  2. Sending the SIGHUP signal to the process group of the interpreter process.
  3. Closing the pipes connected to the interpreter process.

Qp0zEndTerminal() waits for the interpreter process to end before returning to the caller. The status information about how the interpreter process ended is returned in the optional second parameter.


Parameters

handle
(Input) Handle for terminal.
...
(Output) An optional pointer to an integer to store the status information about how the interpreter process ended. See the wait() API for information on interpreting the status information. The status information is only returned when the Return_Exit_Status field is set in the Qp0z_Terminal_Attr_T parameter when the terminal is started by Qp0zStartTerminal().

Authorities

None.

Return Value

0
Qp0zEndTerminal() was successful.
value
Qp0zEndTerminal() was not successful. The value returned is an errno indicating the failure.

Error Conditions

If Qp0zEndTerminal() is not successful, the return value usually indicates one of the following errors. Under some conditions, the return value could indicate an error other than those listed here.

[EFAULT]

The address used for an argument is not correct.

In attempting to use an argument in a call, the system detected an address that is not valid.

While attempting to access a parameter passed to this function, the system detected an address that is not valid.

[EINVAL]
The value specified for the argument is not correct.

A function was passed incorrect argument values, or an operation was attempted on an object and the operation specified is not supported for that type of object.

An argument value is not valid, out of range, or NULL.

[EIO]

Input/output error.

A physical I/O error occurred.

A referenced object may be damaged.

[EUNKNOWN]

Unknown system state.

The operation failed because of an unknown system state. See any messages in the job log and correct any errors that are indicated, then retry the operation.


Usage Notes

  1. The default action for the SIGHUP signal is to end the request. The program running in the interpreter process can use a signal handler to catch the signal and perform any necessary cleanup. See Signals APIs for more information about signals.

Related Information



API introduced: V4R2

[ Back to top | UNIX-Type APIs | APIs by category ]