Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
signal.h File Reference
#include <linux/list.h>
#include <uapi/linux/signal.h>
#include <linux/bitops.h>
#include <linux/string.h>

Go to the source code of this file.

Data Structures

struct  sigqueue
 
struct  sigpending
 

Macros

#define SIGQUEUE_PREALLOC   1
 
#define sigmask(sig)   (1UL << ((sig) - 1))
 
#define _SIG_SET_BINOP(name, op)
 
#define _sig_or(x, y)   ((x) | (y))
 
#define _sig_and(x, y)   ((x) & (y))
 
#define _sig_andn(x, y)   ((x) & ~(y))
 
#define _SIG_SET_OP(name, op)
 
#define _sig_not(x)   (~(x))
 
#define SIGEMT_MASK   0
 
#define rt_sigmask(sig)   sigmask(sig)
 
#define siginmask(sig, mask)   (rt_sigmask(sig) & (mask))
 
#define SIG_KERNEL_ONLY_MASK
 
#define SIG_KERNEL_STOP_MASK
 
#define SIG_KERNEL_COREDUMP_MASK
 
#define SIG_KERNEL_IGNORE_MASK
 
#define sig_kernel_only(sig)   (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_ONLY_MASK))
 
#define sig_kernel_coredump(sig)   (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_COREDUMP_MASK))
 
#define sig_kernel_ignore(sig)   (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_IGNORE_MASK))
 
#define sig_kernel_stop(sig)   (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK))
 
#define sig_user_defined(t, signr)
 
#define sig_fatal(t, signr)
 

Functions

void flush_sigqueue (struct sigpending *queue)
 
int next_signal (struct sigpending *pending, sigset_t *mask)
 
int do_send_sig_info (int sig, struct siginfo *info, struct task_struct *p, bool group)
 
int group_send_sig_info (int sig, struct siginfo *info, struct task_struct *p)
 
int __group_send_sig_info (int, struct siginfo *, struct task_struct *)
 
long do_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info)
 
long do_sigpending (void __user *, unsigned long)
 
int do_sigtimedwait (const sigset_t *, siginfo_t *, const struct timespec *)
 
int sigprocmask (int, sigset_t *, sigset_t *)
 
void set_current_blocked (sigset_t *)
 
void __set_current_blocked (const sigset_t *)
 
int sigsuspend (sigset_t *)
 
int get_signal_to_deliver (siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie)
 
void signal_delivered (int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping)
 
void exit_signals (struct task_struct *tsk)
 
int unhandled_signal (struct task_struct *tsk, int sig)
 
void signals_init (void)
 

Variables

int print_fatal_signals
 
int show_unhandled_signals
 
struct kmem_cachesighand_cachep
 

Macro Definition Documentation

#define _sig_and (   x,
  y 
)    ((x) & (y))

Definition at line 122 of file signal.h.

#define _sig_andn (   x,
  y 
)    ((x) & ~(y))

Definition at line 125 of file signal.h.

#define _sig_not (   x)    (~(x))

Definition at line 149 of file signal.h.

#define _sig_or (   x,
  y 
)    ((x) | (y))

Definition at line 119 of file signal.h.

#define _SIG_SET_BINOP (   name,
  op 
)
Value:
static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
{ \
extern void _NSIG_WORDS_is_unsupported_size(void); \
unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \
\
switch (_NSIG_WORDS) { \
case 4: \
a3 = a->sig[3]; a2 = a->sig[2]; \
b3 = b->sig[3]; b2 = b->sig[2]; \
r->sig[3] = op(a3, b3); \
r->sig[2] = op(a2, b2); \
case 2: \
a1 = a->sig[1]; b1 = b->sig[1]; \
r->sig[1] = op(a1, b1); \
case 1: \
a0 = a->sig[0]; b0 = b->sig[0]; \
r->sig[0] = op(a0, b0); \
break; \
default: \
_NSIG_WORDS_is_unsupported_size(); \
} \
}

Definition at line 95 of file signal.h.

#define _SIG_SET_OP (   name,
  op 
)
Value:
static inline void name(sigset_t *set) \
{ \
extern void _NSIG_WORDS_is_unsupported_size(void); \
\
switch (_NSIG_WORDS) { \
case 4: set->sig[3] = op(set->sig[3]); \
set->sig[2] = op(set->sig[2]); \
case 2: set->sig[1] = op(set->sig[1]); \
case 1: set->sig[0] = op(set->sig[0]); \
break; \
default: \
_NSIG_WORDS_is_unsupported_size(); \
} \
}

Definition at line 133 of file signal.h.

#define rt_sigmask (   sig)    sigmask(sig)

Definition at line 346 of file signal.h.

#define sig_fatal (   t,
  signr 
)
Value:
(t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL)

Definition at line 382 of file signal.h.

#define sig_kernel_coredump (   sig)    (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_COREDUMP_MASK))

Definition at line 371 of file signal.h.

#define SIG_KERNEL_COREDUMP_MASK
Value:
(\
rt_sigmask(SIGQUIT) | rt_sigmask(SIGILL) | \
rt_sigmask(SIGTRAP) | rt_sigmask(SIGABRT) | \
rt_sigmask(SIGFPE) | rt_sigmask(SIGSEGV) | \
rt_sigmask(SIGBUS) | rt_sigmask(SIGSYS) | \
rt_sigmask(SIGXCPU) | rt_sigmask(SIGXFSZ) | \
SIGEMT_MASK )

Definition at line 357 of file signal.h.

#define sig_kernel_ignore (   sig)    (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_IGNORE_MASK))

Definition at line 373 of file signal.h.

#define SIG_KERNEL_IGNORE_MASK
Value:
(\
rt_sigmask(SIGCONT) | rt_sigmask(SIGCHLD) | \
rt_sigmask(SIGWINCH) | rt_sigmask(SIGURG) )

Definition at line 365 of file signal.h.

#define sig_kernel_only (   sig)    (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_ONLY_MASK))

Definition at line 369 of file signal.h.

#define SIG_KERNEL_ONLY_MASK
Value:
(\
rt_sigmask(SIGKILL) | rt_sigmask(SIGSTOP))

Definition at line 350 of file signal.h.

#define sig_kernel_stop (   sig)    (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK))

Definition at line 375 of file signal.h.

#define SIG_KERNEL_STOP_MASK
Value:
(\
rt_sigmask(SIGSTOP) | rt_sigmask(SIGTSTP) | \
rt_sigmask(SIGTTIN) | rt_sigmask(SIGTTOU) )

Definition at line 353 of file signal.h.

#define sig_user_defined (   t,
  signr 
)
Value:
(((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) && \
((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN))

Definition at line 378 of file signal.h.

#define SIGEMT_MASK   0

Definition at line 340 of file signal.h.

#define siginmask (   sig,
  mask 
)    (rt_sigmask(sig) & (mask))

Definition at line 348 of file signal.h.

#define sigmask (   sig)    (1UL << ((sig) - 1))

Definition at line 90 of file signal.h.

#define SIGQUEUE_PREALLOC   1

Definition at line 23 of file signal.h.

Function Documentation

int __group_send_sig_info ( int  ,
struct siginfo ,
struct task_struct  
)

Definition at line 1196 of file signal.c.

void __set_current_blocked ( const sigset_t )

Definition at line 2546 of file signal.c.

long do_rt_tgsigqueueinfo ( pid_t  tgid,
pid_t  pid,
int  sig,
siginfo_t info 
)

Definition at line 2966 of file signal.c.

int do_send_sig_info ( int  sig,
struct siginfo info,
struct task_struct p,
bool  group 
)

Definition at line 1207 of file signal.c.

long do_sigpending ( void __user ,
unsigned  long 
)

Definition at line 2627 of file signal.c.

int do_sigtimedwait ( const sigset_t which,
siginfo_t info,
const struct timespec ts 
)

do_sigtimedwait - wait for queued signals specified in : queued signals to wait for : if non-null, the signal's siginfo is returned here : upper bound on process time suspension

Definition at line 2749 of file signal.c.

void exit_signals ( struct task_struct tsk)

Definition at line 2439 of file signal.c.

void flush_sigqueue ( struct sigpending queue)

Definition at line 399 of file signal.c.

int get_signal_to_deliver ( siginfo_t info,
struct k_sigaction return_ka,
struct pt_regs regs,
void cookie 
)

Definition at line 2190 of file signal.c.

int group_send_sig_info ( int  sig,
struct siginfo info,
struct task_struct p 
)

Definition at line 1313 of file signal.c.

int next_signal ( struct sigpending pending,
sigset_t mask 
)

Definition at line 167 of file signal.c.

void set_current_blocked ( sigset_t newset)

set_current_blocked - change current->blocked mask : new mask

It is wrong to change ->blocked directly, this helper should be used to ensure the process can't miss a shared signal we are going to block.

Definition at line 2537 of file signal.c.

void signal_delivered ( int  sig,
siginfo_t info,
struct k_sigaction ka,
struct pt_regs regs,
int  stepping 
)

signal_delivered - : number of signal being delivered : siginfo_t of signal being delivered : sigaction setting that chose the handler : user register state : nonzero if debugger single-step or block-step in use

This function should be called when a signal has succesfully been delivered. It updates the blocked signals accordingly (->sa.sa_mask is always blocked, and the signal itself is blocked unless SA_NODEFER is set in ->sa.sa_flags. Tracing is notified.

Definition at line 2389 of file signal.c.

void signals_init ( void  )

Definition at line 3299 of file signal.c.

int sigprocmask ( int  ,
sigset_t ,
sigset_t  
)

Definition at line 2563 of file signal.c.

int sigsuspend ( sigset_t )

Definition at line 3262 of file signal.c.

int unhandled_signal ( struct task_struct tsk,
int  sig 
)

Definition at line 492 of file signal.c.

Variable Documentation

int print_fatal_signals
int show_unhandled_signals

Definition at line 47 of file traps.c.

struct kmem_cache* sighand_cachep

Definition at line 186 of file fork.c.