Qp2SignalPase()--Post an IBM PASE for i Signal


  Syntax
 #include <qp2user.h>

 int Qp2SignalPase(int   signo);  

  Service Program Name: QP2USER

  Default Public Authority: *USE

  Threadsafe: Yes

The Qp2SignalPase() function posts an IBM® i Portable Application Solutions Environment (IBM PASE for i) signal to an IBM PASE for i 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 IBM PASE for i signal. ILE and IBM PASE for i 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 IBM PASE for i (and AIX®) signal number.

Authorities

None.


Return Value

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

QP2CALLPASE_NORMAL(0) An IBM PASE for i signal was posted successfully.

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

QP2CALLPASE_ARG_ERROR(4) The signo parameter value is invalid.

QP2CALLPASE_TERMINATING(6) The IBM PASE for i program is terminating. No function result was returned. The IBM PASE for i 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 IBM PASE for i 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 IBM PASE for i 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 IBM PASE for i signals to the parent of any fork child process that ends).

  3. If there is only one IBM PASE for i thread running in the job, the signal remains pending until control is transferred to the IBM PASE for i program. If other IBM PASE for i 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

[ Back to top | IBM PASE for i APIs | APIs by category ]