task_current_syscall(9)
β¨ task_current_syscall(9) β¨
ok so this is a page from the Kernel API Manual, section 9, and it's literally called task_current_syscall β bestie, it lets you peek at what a blocked task is actually doing π
πΈ NAME πΈ
task_current_syscall β discover what a blocked task is doing π
π¦ SYNOPSIS π¦
int task_current_syscall (struct task_struct *target , struct syscall_info *info );
π ARGUMENTS π
targetβ the thread to examine π (yes, that thread, the one you're being nosy about)infoβ a structure with these fields, and bestie, pay attention to each one:.spβ filled with the user stack pointer π§.data.nrβ filled with the system call number, or-1π.data.argsβ filled with themaxargssystem call arguments π.data.instruction_pointerβ filled with the user PC β
π DESCRIPTION π
So here's the vibe: if target is blocked in a system call, this returns zero, with info.data.nr set to the call's number and info.data.args filled in with its arguments. π«Ά Registers not used for system call arguments may not be available, and listen β it is not kosher to use struct user_regset calls while the system call is still in progress. π Ngl, that's the rules.
Heads up: we may get this result if target has finished its system call but not yet returned to user mode β like when it's stopped for signal handling or syscall exit tracing. So don't @ me if it looks done but isn't done done. π
Now, if target is blocked in the kernel during a fault or exception, it returns zero with *info.data.nr set to -1 and does not fill in info.data.args. π But good news: if that's the case, it's now safe to examine target using struct user_regset get calls β as long as we're sure target won't return to user mode. π
And if target does not remain blocked? Returns -EAGAIN. Periodt. π
π₯ SEE ALSO π₯
- Kernel file
./lib/syscall.cβ go read it, iykyk π
and that's the whole manual, no cap β¨
kisses, this page came from ./lib, dated October 2026, and it'll live forever in your heart as task_current_syscall(9) πππ¦
π¦ 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