The "s" Package

These routines are meant to provide a simplified interface to the Unix signal management routines. These routines allow blocking and unblocking of signals without the dangers of deadlock (common on multi-threaded machines). A few "standard" signal handlers are also provided.

Library: karma
Link With: -lkarma

Functions

s_blockBlock a signal.
s_unblockUnblock a signal.
s_unblock_allUnblock all signals.
s_ignoreCause a signal to be ignored.
s_int_handlerRecommended SIGINT handler.
s_term_handlerRecommended SIGTERM handler.
s_check_for_intCheck for queued SIGINTs.


Functions


void s_block (int signal)

This routine will cause a signal to be blocked until a subsequent call to s_unblock or s_unblock_all. If the signal is already blocked, no action is taken.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


void s_unblock (int signal)

This routine will cause a signal to be unblocked. If the signal is not already blocked, no action is taken.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


void s_unblock_all ()

This routine will cause all signals blocked by s_block to be unblocked. If no signals were blocked, no action is taken.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


void * s_ignore (int sig)

Cause a signal to be ignored.

Parameters:

Returns: The previous signal handler.
Multithreading Level: Unsafe


void s_int_handler ()

This routine will handle SIGINT signals (those generated by the C shell in response to a control C keypress).

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


void s_term_handler ()

This routine will handle SIGTERM signals.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag s_check_for_int ()

This routine will check if there is a queued interrupt (SIGINT) pending.

Parameters:

Returns: TRUE if there is a queued SIGINT, else FALSE.
Multithreading Level: Unsafe


Contact: Richard Gooch
Web Development: Ariel Internet Services