Qp2SignalPase()--Post an i5/OS PASE Signal


  Syntax
 #include <qp2user.h>

 int Qp2SignalPase(int   signo);  

  Service Program Name: QP2USER

  Default Public Authority: *USE

  Threadsafe: Yes

The Qp2SignalPase() function posts an i5/OS Portable Application Solutions Environment (i5/OS PASE) signal to an i5/OS PASE program that is already running in the job.


Parameters

signo
(Input) Signal number to post. A positive value is an ILE signal number, which causes the system to post a corresponding i5/OS PASE signal. ILE and i5/OS PASE signals correspond if they have the same name (for example, SIGTERM) in a system-provided header file. A negative value is the negation of an i5/OS PASE (and AIX) signal number.

Authorities

None.


Return Value

The function result is an integer that indicates whether the i5/OS PASE signal was posted successfully. Header file qp2user.h defines the following constants for the return code from Qp2SignalPase:

QP2CALLPASE_NORMAL(0) An i5/OS PASE signal was posted successfully.

QP2CALLPASE_ENVIRON_ERROR(2) The operation is not allowed because no i5/OS PASE program is running in the job, or the thread that called Qp2CallPase was neither the initial i5/OS PASE thread nor a thread created using i5/OS PASE pthread interfaces.

QP2CALLPASE_ARG_ERROR(4) The signo parameter value is invalid.

QP2CALLPASE_TERMINATING(6) The i5/OS PASE program is terminating. No function result was returned. The i5/OS PASE program may have run the exit function, or a signal might have caused the program to terminate.

Usage Notes

  1. Qp2SignalPase is supported only when an i5/OS PASE program is currently running in the job. This means that Qp2RunPase must be actively called in the job, or the job must be a fork child process.

  2. Not all ILE signals have an i5/OS PASE equivalent and Qp2SignalPase never converts ILE SIGCHLD to a corresponding PASE signal. This special handling for SIGCHLD avoids duplicate PASE signals for the termination of a single child process (because the system may send both ILE and i5/OS PASE signals to the parent of any fork child process that ends).

  3. If there is only one i5/OS PASE thread running in the job, the signal remains pending until control is transferred to the i5/OS PASE program. If other i5/OS PASE threads are running at the time Qp2SignalPase is called, the system may chose one of the other threads to deliver the signal.

Related Information



API introduced: V4R5
Top | i5/OS PASE APIs | APIs by category