limit_sigs or sigsetmask Kernel Service

Purpose

Changes the signal mask for the calling kernel thread.

Syntax

#include <sys/encap.h>

void limit_sigs (
siglist,
old_mask)
sigset_t *siglist;
sigset_t *old_mask;

void sigsetmask ( old_mask)
sigset_t *old_mask;

Parameters

Item Description
siglist Specifies the signal set to deliver.
old_mask Points to the old signal set.

Description

The limit_sigs kernel service changes the signal mask for the calling kernel thread such that only the signals specified by the siglist parameter will be delivered, unless they are currently being blocked or ignored.

The old signal mask is returned via the old_mask parameter. If the siglist parameter is NULL, the signal mask is not changed; it can be used for getting the current signal mask.

The sigsetmask kernel service should be used to restore the set of blocked signals for the calling thread. The typical usage of these services is the following:

sigset_t allowed = limited set of signals
sigset_t old;
 
/* limits the set of delivered signals */
limit_sigs (&allowed, &old);
 
   /* do something with a limited set of delivered signals */
 
/* restore the original set */
sigsetmask (&old);

Execution Environment

The limit_sigs and sigsetmask kernel services can be called from the process environment only.

Return Values

The limit_sigs and sigsetmask kernel services have no return values.