/home/vlg/develop/libASSA/libassa/assa/SigAction.h File Reference

SigAction is a C++ wrapper around sigaction structure. More...

#include <signal.h>
#include <errno.h>
#include "assa/Assure.h"
#include "assa/SigSet.h"

Include dependency graph for SigAction.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ASSA

Classes

class  ASSA::SigAction

Typedefs

typedef sigaction SIGACTION
typedef void(* C_SIG_HANDLER )(int)


Detailed Description

SigAction is a C++ wrapper around sigaction structure.

Class SigAction implements a C++ wrapper around struct sigaction. It class also provides a range of all possible operation that can be performed on it, including sigaction(2) system call.

struct sigaction is defined as:

   struct sigaction {
       void      (*sa_handler) ();
       sigset_t  sa_mask;
       int       sa_flags;
       void      (*sa_sigaction) (int, siginfo_t*, void*);
   };

It is used to set all the details of what your process should do when a signal arrives. It encapsulates the action to be taken on receipt of a particular signal.

The most important member is sa_handler, which takes a pointer to a function. This function will be invoked whenever the process gets a particular POSIX.1 signal.

Some of the member function of SigAction class take a parameter of type C_SIG_HANDLER.

It can be one of:

The sa_mask mask for the signal action specifies a set of signals to be blocked while the signal handler is active. On the entry into the signal handler, that set of signals is added to a set of signals already being blocked from delivery when the signal is delivered to the process. In addition, the signal that caused the handler to be executed will also be blocked (SIGSTOP and SIGKILL cannot be blocked - this is enforced by the underlying OS).

Flags sa_flags in the set of flags ORed that allows to modify the delivery of the signal. POSIX.1 spec. defines only SA_NOCLDSTOP flag. All other flags are system-dependent. Consult your local sigaction(2) man page for details.

Because SigAction is a wrapper around sigaction(2), after sig_handler returns (and before anything else), the OS will reinstall current disposition for the signal. To reset signal's disposition to SIG_DFL, SUN Solaris OS uses flag SA_RESETHAND, and Linux OS uses SA_ONESHOT.

Definition in file SigAction.h.


Typedef Documentation

typedef void(* C_SIG_HANDLER)(int)
 

Definition at line 28 of file SigAction.h.

typedef struct sigaction SIGACTION
 

Definition at line 27 of file SigAction.h.


Generated on Sun Aug 13 15:08:13 2006 for libassa by  doxygen 1.4.6