00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INCLUDED_GR_LOCAL_SIGHANDLER_H
00024 #define INCLUDED_GR_LOCAL_SIGHANDLER_H
00025
00026 #ifdef HAVE_SIGNAL_H
00027 #include <signal.h>
00028 #endif
00029
00030 #include <string>
00031
00038 class gr_local_sighandler {
00039 int d_signum;
00040 #ifdef HAVE_SIGACTION
00041 struct sigaction d_old_action;
00042 #endif
00043 public:
00044 gr_local_sighandler (int signum, void (*new_handler)(int));
00045 ~gr_local_sighandler ();
00046
00047
00048 static void throw_signal (int signum);
00049 };
00050
00054 class gr_signal
00055 {
00056 int d_signum;
00057 public:
00058 gr_signal (int signum) : d_signum (signum) {}
00059 int signal () const { return d_signum; }
00060 std::string name () const;
00061 };
00062
00063 #endif