[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

sig_chk Kernel Service

Purpose

Provides a kernel process the ability to poll for receipt of signals.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/signal.h>
int sig_chk ()

Description

Attention: A system crash will occur if the sig_chk service is not called by a kernel process.

The sig_chk kernel service can be called by a kernel thread in kernel mode to determine if any unmasked signals have been received. Signals do not preempt threads because serialization of critical data areas would be lost. Instead, threads must poll for signals, either periodically or after a long sleep has been interrupted by a signal.

The sig_chk service checks for any pending signal that has a specified signal catch or default action. If one is found, the service returns the signal number as its return value. It also removes the signal from the pending signal mask. If no signal is found, this service returns a value of 0. The sig_chk service does not return signals that are blocked or ignored. It is the responsibility of the kernel process to handle the signal appropriately.

For kernel-only threads, the sig_chk kernel service clears the returned signal from the list of pending signals. For other kernel threads, the signal is not cleared, but left pending. It will be delivered to the kernel thread as soon as it returns to the user mode.

Understanding Kernel Threads in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts provides more information about kernel-only thread signal handling.

Execution Environment

The sig_chk kernel service can be called from the process environment only.

Return Values

Upon completion, the sig_chk service returns a value of 0 if no pending unmasked signal is found. Otherwise, it returns a nonzero signal value indicating the number of the highest priority signal that is pending. Signal values are defined in the /usr/include/sys/signal.h file.

Implementation Specifics

The sig_chk kernel service is part of the Base Operating System (BOS) Runtime.

Related Information

Introduction to Kernel Processes, Process and Exception Management Kernel Services, and Kernel Process Signal and Exception Handling in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]