ptrace_trap_notify(9)
π NAME π
ptrace_trap_notify β schedule trap to notify ptracer. Like the name says, bestie: it schedules a trap so the ptracer gets a lil notification. π
β¨ SYNOPSIS β¨
void ptrace_trap_notify (struct task_struct *t );
π«Ά ARGUMENTS π«Ά
tβ the tracee that's wanting to notify its tracer π
π DESCRIPTION π
This function schedules a sticky ptrace trap, and that trap is cleared on the next TRAP_STOP so the ptracer gets notified of an event. β¨ And hello? t must have been seized by the ptracer β that's the vibe check.
If t is running, the STOP trap will be taken. If t is trapped for STOP and the ptracer is listening for events, the tracee is woken up so it can re-trap for the new event. If t is trapped otherwise, the STOP trap will eventually be taken without returning to userland after the existing traps are finished by PTRACE_CONT. π
π CONTEXT π
β οΈ Must be called with task->sighand->siglock held. That's not optional, bestie β lock check or it's giving bad vibes. π
π SEE ALSO π
Kernel file ./kernel/signal.c plus the whole squad:
task_set_jobctl_pending(9)task_clear_jobctl_trapping(9)task_clear_jobctl_pending(9)task_participate_group_stop(9)force_sig_seccomp(9)do_notify_parent_cldstop(9)do_signal_stop(9)do_jobctl_trap(9)do_freezer_trap(9)signal_delivered(9)sys_restart_syscall(9)set_current_blocked(9)sys_rt_sigprocmask(9)sys_rt_sigpending(9)copy_siginfo_to_external32(9)do_sigtimedwait(9)sys_rt_sigtimedwait(9)sys_kill(9)sys_pidfd_send_signal(9)sys_tgkill(9)sys_tkill(9)sys_rt_sigqueueinfo(9)sys_sigpending(9)sys_sigprocmask(9)sys_rt_sigaction(9)sys_rt_sigsuspend(9)
okay that's the whole page, bestie π it's from ./kernel and dated October 2026 β mwah, go call it with the lock held πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms