diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tracehook.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 17ba82efa483..1eb44a924e56 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tracing hooks | 2 | * Tracing hooks |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -463,22 +463,38 @@ static inline int tracehook_get_signal(struct task_struct *task, | |||
463 | 463 | ||
464 | /** | 464 | /** |
465 | * tracehook_notify_jctl - report about job control stop/continue | 465 | * tracehook_notify_jctl - report about job control stop/continue |
466 | * @notify: nonzero if this is the last thread in the group to stop | 466 | * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED |
467 | * @why: %CLD_STOPPED or %CLD_CONTINUED | 467 | * @why: %CLD_STOPPED or %CLD_CONTINUED |
468 | * | 468 | * |
469 | * This is called when we might call do_notify_parent_cldstop(). | 469 | * This is called when we might call do_notify_parent_cldstop(). |
470 | * It's called when about to stop for job control; we are already in | ||
471 | * %TASK_STOPPED state, about to call schedule(). It's also called when | ||
472 | * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made. | ||
473 | * | 470 | * |
474 | * Return nonzero to generate a %SIGCHLD with @why, which is | 471 | * @notify is zero if we would not ordinarily send a %SIGCHLD, |
475 | * normal if @notify is nonzero. | 472 | * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD. |
476 | * | 473 | * |
477 | * Called with no locks held. | 474 | * @why is %CLD_STOPPED when about to stop for job control; |
475 | * we are already in %TASK_STOPPED state, about to call schedule(). | ||
476 | * It might also be that we have just exited (check %PF_EXITING), | ||
477 | * but need to report that a group-wide stop is complete. | ||
478 | * | ||
479 | * @why is %CLD_CONTINUED when waking up after job control stop and | ||
480 | * ready to make a delayed @notify report. | ||
481 | * | ||
482 | * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal. | ||
483 | * | ||
484 | * Called with the siglock held. | ||
478 | */ | 485 | */ |
479 | static inline int tracehook_notify_jctl(int notify, int why) | 486 | static inline int tracehook_notify_jctl(int notify, int why) |
480 | { | 487 | { |
481 | return notify || (current->ptrace & PT_PTRACED); | 488 | return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; |
489 | } | ||
490 | |||
491 | /** | ||
492 | * tracehook_finish_jctl - report about return from job control stop | ||
493 | * | ||
494 | * This is called by do_signal_stop() after wakeup. | ||
495 | */ | ||
496 | static inline void tracehook_finish_jctl(void) | ||
497 | { | ||
482 | } | 498 | } |
483 | 499 | ||
484 | #define DEATH_REAP -1 | 500 | #define DEATH_REAP -1 |