sys_getpid(9)
π NAME π
okay bestie, welcome to sys_getpid(9) β the Kernel API Manual page that's literally about the current process. This one is sys_getpid β it returns the thread group id of the current process. π
β¨ SYNOPSIS β¨
Like, the whole signature is this and only this:
long sys_getpid (void );
π¦ ARGUMENTS π¦
voidβ no arguments. Not a single one. The vibe is empty in the best way. π«Ά
π DESCRIPTION π
Okay so note: despite the name, sys_getpid returns the tgid, not the pid. The tgid and the pid are identical unless CLONE_THREAD was specified on clone, in which case the tgid is the same in all threads of the same group. Periodt. π
This is SMP safe because current->tgid does not change. No cap, it's stable like that. β¨
π SEE ALSO π
go peek at these too, bestie:
- Kernel file
./kernel/sys.c do_sysinfo(9)
okay bestie, that's the page π β source/version is ./kernel, dated October 2026, and yes, it's still sys_getpid(9) in the Kernel API Manual. slay β¨π
π
π¦ 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