summaryrefslogtreecommitdiff
path: root/include/linux/tracehook.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-26 06:45:54 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:00:09 +0400
commitfa00b80b3c41a845b3d56f866fb40a2e98754c51 (patch)
tree819d6966cad1fdeef3f32497c696afb203e3720b /include/linux/tracehook.h
parent7bcf6a2ca5f639b038c48711ebe6c4eca2036641 (diff)
downloadlinux-fa00b80b3c41a845b3d56f866fb40a2e98754c51.tar.xz
tracehook: job control
This defines the tracehook_notify_jctl() hook to formalize the ptrace effects on the job control notifications. 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.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 42a0d7b11959..6dc428dd2f38 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -451,4 +451,24 @@ static inline int tracehook_get_signal(struct task_struct *task,
return 0;
}
+/**
+ * tracehook_notify_jctl - report about job control stop/continue
+ * @notify: nonzero if this is the last thread in the group to stop
+ * @why: %CLD_STOPPED or %CLD_CONTINUED
+ *
+ * This is called when we might call do_notify_parent_cldstop().
+ * It's called when about to stop for job control; we are already in
+ * %TASK_STOPPED state, about to call schedule(). It's also called when
+ * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made.
+ *
+ * Return nonzero to generate a %SIGCHLD with @why, which is
+ * normal if @notify is nonzero.
+ *
+ * Called with no locks held.
+ */
+static inline int tracehook_notify_jctl(int notify, int why)
+{
+ return notify || (current->ptrace & PT_PTRACED);
+}
+
#endif /* <linux/tracehook.h> */