Ejemplo n.º 1
0
# define SIGRTMIN 0
# undef SIGRTMAX
#endif
#ifndef SIGRTMAX
# define SIGRTMAX (SIGRTMIN - 1)
#endif

#define NUMNAME(name) { SIG##name, #name }

/* Signal names and numbers.  Put the preferred name first.  */
static struct numname { int num; char const name[8]; } numname_table[] =
  {
    /* Signals required by POSIX 1003.1-2001 base, listed in
       traditional numeric order where possible.  */
#ifdef SIGHUP
    NUMNAME (HUP),
#endif
#ifdef SIGINT
    NUMNAME (INT),
#endif
#ifdef SIGQUIT
    NUMNAME (QUIT),
#endif
#ifdef SIGILL
    NUMNAME (ILL),
#endif
#ifdef SIGTRAP
    NUMNAME (TRAP),
#endif
#ifdef SIGABRT
    NUMNAME (ABRT),
Ejemplo n.º 2
0
   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#include <signal.h>
#include <ctype.h>

/* Based on ideas from sig2str.c in gnulib.  */

#define NUMNAME(name)   { SIG##name, #name }
#define RTNAME(num)     { __SIGRTMIN + num, "RTMIN" #num }

static struct _siglist { int num; char name[8]; } siglist[] =
  {
    NUMNAME (HUP), NUMNAME (INT), NUMNAME (QUIT), NUMNAME (ILL),
    NUMNAME (TRAP), NUMNAME (IOT), NUMNAME (EMT), NUMNAME (FPE),
    NUMNAME (KILL), NUMNAME (BUS), NUMNAME (SEGV), NUMNAME (SYS),
    NUMNAME (PIPE), NUMNAME (ALRM), NUMNAME (TERM), NUMNAME (USR1),
    NUMNAME (USR2), NUMNAME (CHLD), NUMNAME (PWR), NUMNAME (WINCH),
    NUMNAME (URG), NUMNAME (POLL), NUMNAME (IO), NUMNAME (STOP),
    NUMNAME (TSTP), NUMNAME (CONT), NUMNAME (TTIN), NUMNAME (TTOU),
    NUMNAME (VTALRM), NUMNAME (PROF), NUMNAME (XCPU), NUMNAME (XFSZ),
    NUMNAME (WAITING), NUMNAME (LWP), NUMNAME (FREEZE), NUMNAME (THAW),
    NUMNAME (CANCEL), NUMNAME (LOST), NUMNAME (XRES), NUMNAME (JVM1),
    NUMNAME (JVM2), { __SIGRTMIN, "RTMIN" }, RTNAME (+1), RTNAME (+2),
    RTNAME (+3), RTNAME (-3), RTNAME (-2), RTNAME (-1),
    { __SIGRTMAX, "RTMAX"}
  };

#define SIGLIST_SIZE    (sizeof (siglist) / sizeof (siglist[0]))