Back to index

glibc  2.9
Functions | Variables
signal.c File Reference
#include <errno.h>
#include <signal.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


__sighandler_t __bsd_signal (int sig, __sighandler_t handler)


sigset_t _sigintr attribute_hidden

Function Documentation

Definition at line 31 of file signal.c.

  struct sigaction act, oact;

  /* Check signal extents to protect __sigismember.  */
  if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
      __set_errno (EINVAL);
      return SIG_ERR;

  act.sa_handler = handler;
  if (__sigemptyset (&act.sa_mask) < 0
      || __sigaddset (&act.sa_mask, sig) < 0)
    return SIG_ERR;
  act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
  if (__sigaction (sig, &act, &oact) < 0)
    return SIG_ERR;

  return oact.sa_handler;

Here is the call graph for this function:

Variable Documentation

Definition at line 26 of file signal.c.