Back to index

glibc  2.9
Defines | Functions
sigaction.c File Reference
#include <sysdep.h>
#include <errno.h>
#include <stddef.h>
#include <signal.h>
#include <string.h>
#include <sys/syscall.h>
#include <kernel-features.h>
#include <kernel_sigaction.h>
#include "ucontext_i.h"

Go to the source code of this file.

Defines

#define SA_RESTORER   0x04000000
#define do_cfa_expr
#define do_expr(regno, offset)
#define RESTORE(name, syscall)   RESTORE2 (name, syscall)
#define RESTORE2(name, syscall)

Functions

void restore_rt (void)

Define Documentation

#define do_cfa_expr
Value:
"      .byte 0x0f\n"        /* DW_CFA_def_cfa_expression */    \
  "    .uleb128 2f-1f\n"    /* length */                \
  "1:  .byte 0x77\n"        /* DW_OP_breg7 */           \
  "    .sleb128 " CFI_STRINGIFY (oRSP) "\n"                    \
  "    .byte 0x06\n"        /* DW_OP_deref */           \
  "2:"
#define do_expr (   regno,
  offset 
)
Value:
"      .byte 0x10\n"        /* DW_CFA_expression */            \
  "    .uleb128 " CFI_STRINGIFY (regno) "\n"                   \
  "    .uleb128 2f-1f\n"    /* length */                \
  "1:  .byte 0x77\n"        /* DW_OP_breg7 */           \
  "    .sleb128 " CFI_STRINGIFY (offset) "\n"                  \
  "2:"
#define RESTORE (   name,
  syscall 
)    RESTORE2 (name, syscall)
#define RESTORE2 (   name,
  syscall 
)
#define SA_RESTORER   0x04000000

Definition at line 39 of file sigaction.c.


Function Documentation

void restore_rt ( void  )

Definition at line 43 of file sigaction.c.

{
  int result;
  struct kernel_sigaction kact, koact;

  if (act)
    {
      kact.k_sa_handler = act->sa_handler;
      memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
      kact.sa_flags = act->sa_flags | SA_RESTORER;

      kact.sa_restorer = &restore_rt;
    }

  /* XXX The size argument hopefully will have to be changed to the
     real size of the user-level sigset_t.  */
  result = INLINE_SYSCALL (rt_sigaction, 4,
                        sig, act ? __ptrvalue (&kact) : NULL,
                        oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
  if (oact && result >= 0)
    {
      oact->sa_handler = koact.k_sa_handler;
      memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
      oact->sa_flags = koact.sa_flags;
      oact->sa_restorer = koact.sa_restorer;
    }
  return result;
}

Here is the caller graph for this function: