aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tracehook.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-25 22:45:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:09 -0400
commit445a91d2fe3667fb8fc251433645f686933cf56a (patch)
tree496f0715ba3079f3bf98e9808480fe7f25872b16 /include/linux/tracehook.h
parent35de254dc60f91004b3b5ebb1fc7b2c3093d6032 (diff)
tracehook: tracehook_consider_fatal_signal
This defines tracehook_consider_fatal_signal() has a fine-grained hook for deciding to skip the special cases for a fatal signal, as ptrace does. There is no change, only cleanup. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/tracehook.h')
-rw-r--r--include/linux/tracehook.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 8cffd34f88d5..8b4c15e208fe 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -331,4 +331,25 @@ static inline int tracehook_consider_ignored_signal(struct task_struct *task,
331 return (task_ptrace(task) & PT_PTRACED) != 0; 331 return (task_ptrace(task) & PT_PTRACED) != 0;
332} 332}
333 333
334/**
335 * tracehook_consider_fatal_signal - suppress special handling of fatal signal
336 * @task: task receiving the signal
337 * @sig: signal number being sent
338 * @handler: %SIG_DFL or %SIG_IGN
339 *
340 * Return nonzero to prevent special handling of this termination signal.
341 * Normally @handler is %SIG_DFL. It can be %SIG_IGN if @sig is ignored,
342 * in which case force_sig() is about to reset it to %SIG_DFL.
343 * When this returns zero, this signal might cause a quick termination
344 * that does not give the debugger a chance to intercept the signal.
345 *
346 * Called with or without @task->sighand->siglock held.
347 */
348static inline int tracehook_consider_fatal_signal(struct task_struct *task,
349 int sig,
350 void __user *handler)
351{
352 return (task_ptrace(task) & PT_PTRACED) != 0;
353}
354
334#endif /* <linux/tracehook.h> */ 355#endif /* <linux/tracehook.h> */