Back to index

glibc  2.9
Functions | Variables
psignal.c File Reference
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <libintl.h>
#include <wchar.h>

Go to the source code of this file.

Functions

void psignal (int sig, const char *s)

Variables

const char *const _sys_siglist []
const char *const
_sys_siglist_internal[] 
attribute_hidden

Function Documentation

void psignal ( int  sig,
const char *  s 
)

Definition at line 36 of file psignal.c.

{
  const char *colon, *desc;

  if (s == NULL || s == '\0')
    s = colon = "";
  else
    colon = ": ";

  if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL)
    (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _(desc));
  else
    {
      char *buf;

      if (__asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig) < 0)
       (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _("Unknown signal"));
      else
       {
         (void) __fxprintf (NULL, "%s", buf);

         free (buf);
       }
    }
}

Here is the call graph for this function:


Variable Documentation

Definition at line 24 of file siglist.c.

const char* const _sys_siglist_internal [] attribute_hidden

Definition at line 25 of file init-first.c.