Skip to content

Commit

Permalink
Add fatal_signal_pending
Browse files Browse the repository at this point in the history
Like signal_pending, but it's only true for signals which are fatal to
this process

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
  • Loading branch information
Matthew Wilcox authored and Matthew Wilcox committed Dec 6, 2007
1 parent f021a3c commit f776d12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,14 @@ static inline int signal_pending(struct task_struct *p)
{
return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
}


extern int FASTCALL(__fatal_signal_pending(struct task_struct *p));

static inline int fatal_signal_pending(struct task_struct *p)
{
return signal_pending(p) && __fatal_signal_pending(p);
}

static inline int need_resched(void)
{
return unlikely(test_thread_flag(TIF_NEED_RESCHED));
Expand Down
5 changes: 5 additions & 0 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,11 @@ void zap_other_threads(struct task_struct *p)
}
}

int fastcall __fatal_signal_pending(struct task_struct *tsk)
{
return sigismember(&tsk->pending.signal, SIGKILL);
}

/*
* Must be called under rcu_read_lock() or with tasklist_lock read-held.
*/
Expand Down

0 comments on commit f776d12

Please sign in to comment.