syscall_get_return_value(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… syscall_get_return_value β€” kernel API manual, but make it cute

Okay bestie, settle in, because we're talking about syscall_get_return_value(9) β€” yes, that's the function, and yes, 9 is the section number because this is Kernel API Manual territory, not your average section-1 situation. πŸŽ€


✨ NAME ✨

syscall_get_return_value β€” literally just "get the return value of a traced system call." That's the whole vibe. 🫢


🌸 SYNOPSIS 🌸

long syscall_get_return_value (struct task_struct *task , struct pt_regs *regs );

Look at her. Two pointers, one long. Iconic signature, no notes. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • task β€” the task of interest, and heads up: it must be blocked. Not optional, not a suggestion, this is a vibe check she has to pass. 😭
  • regs β€” the task_pt_regs of task. That's it, that's the arg. πŸ’œ

πŸ”₯ DESCRIPTION πŸ”₯

So what does she actually do? She returns the return value of the successful system call. Periodt. ✨

⚠️ But listen β€” that value is meaningless if syscall_get_error returned nonzero. Like, don't even look at it. It's giving "wrong answer but confidently." πŸ’€

And the big one, no cap: it's only valid to call this when task is stopped for tracing on exit from a system call, due to SYSCALL_WORK_SYSCALL_TRACE or SYSCALL_WORK_SYSCALL_AUDIT. Any other time? Not the move. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/asm-generic/syscall.h β€” and her whole friend group:


πŸ’– That's the whole page, bestie β€” go forth and trace responsibly. πŸ’–

Oh and before I forget, the source line lives at ./include/asm-generic, and this cutie is dated October 2026 β€” future-dated manual page, main character energy fr fr. πŸŒˆβ­πŸ“

πŸ“¦ where this page comes from