When a job is running in i5/OS, by default it is not enabled for POSIX signals. The system never delivers a Posix signal to a job that is not enabled for signals.
The job is initialized for signals with the default POSIX signals environment when any thread in the job calls any API defined to implicitly enable signals. The main categories of APIs that enable signals are the signals APIs themselves and some process-related APIs related to signals. For example, some of the APIs that enable signals are Qp0sEnableSignals(), kill(), sigaction(), sigprocmask(), getpid(), and spawn(). After the initialization for signals occurs within a job, the system can deliver signals to that job if they are generated by another job or by the system.
When a program in a job uses Pthreads, that job is automatically enabled for signals when the Pthreads service program is loaded (either dynamically or statically). Loading the service program that contains the Pthread APIs causes the job to be initialized for signals, regardless of whether the application actually calls the pthread APIs. All pthread programs can implicitly receive signals if another job or the system generates a signal for the threaded job.
If the application calls Qp0sDisableSignals() to disable signals for the job, the Pthreads APIs do not function correctly. Do not use Qp0sDisableSignals() in a threaded job.
For more information about signals and the APIs mentioned in this section, see Signal APIs and Process-Related APIs.
Pthread APIs | APIs by category |