is_global_init(9)
π is_global_init(9) π
okay bestie, welcome to is_global_init(9) from the Kernel API Manual β this is the little function that does a very specific vibe check on task structures, and honestly? iconic. β¨
πΈ NAME πΈ
is_global_init β check if a task structure is init. Since init is free to have sub-threads, we need to check tgid. π«Ά
π SYNOPSIS π
int is_global_init (struct task_struct *tsk );
π¦ ARGUMENTS π¦
tskβ the task structure that's getting checked, aka the main character of this function call π
β¨ DESCRIPTION β¨
Check if a task structure is the first user space task the kernel created. That's it, that's the whole job β but it's important, and it ate. π₯
π RETURN π
Returns 1 if the task structure is init. Returns 0 otherwise. no cap, those are the only two outcomes π
π SEE ALSO π
- Kernel file
./include/linux/pid.h pid_alive(9)
β cute little sign-off: brought to you by ./include/linux, October 2026, and the page is_global_init(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