wait_task_stopped(9)
π NAME π
okay so bestie, this is wait_task_stopped(9) from the Kernel API Manual, and it's literally here to Wait for %TASK_STOPPED or %TASK_TRACED. no cap. π
β¨ SYNOPSIS β¨
int wait_task_stopped (struct wait_opts *wo , int ptrace , struct
task_struct *p );
copy that signature exactly, bestie β commas, spaces, semicolon, all of it. π«Ά
πΈ ARGUMENTS πΈ
woβ wait options. the options bag, basically.ptraceβ is the wait for ptrace.pβ task to wait for. the task we're waiting on, periodt.
π DESCRIPTION π
So the job is: handle sys_wait4 work for p in state TASK_STOPPED or TASK_TRACED. that's it, that's the function. iconic. β¨
π CONTEXT π
Context is read_lock(tasklist_lock), which is released if the return value is non-zero. Also, it grabs and releases p->sighand->siglock. so yeah, lock business is happening β don't forget it. π
π§ RETURN π§
0β the wait condition didn't exist, and the search for other wait conditions should continue. keep looking, bestie. π- Non-zero return β
-errnoon failure andp's pid on success. this implies thattasklist_lockis released and the wait condition search should terminate. so stop searching when you see it. π₯
π SEE ALSO π
Kernel file ./kernel/exit.c β go read it, iykyk. π
mwah π β source/version: ./kernel; date: October 2026. that's the cute little footer sign-off, bestie, byeeee π«Άπ
π¦ 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