bpf_task_get_cgroup1(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🫢 bpf_task_get_cgroup1(9) 🫢

Hey bestie, welcome to the Kernel API Manual, section 9 β€” this is the bpf_task_get_cgroup1(9) page, and it's lowkey iconic. Let's get into it πŸ’…βœ¨

🌸 NAME 🌸

bpf_task_get_cgroup1 β€” grabs the cgroup associated with a task, but only within a specific cgroup1 hierarchy. That cgroup1 hierarchy is identified by its hierarchy ID. No cap, that's the whole point 🫢

✨ SYNOPSIS ✨

       __bpf_kfunc struct cgroup * bpf_task_get_cgroup1 (struct task_struct
       *task , int hierarchy_id );

πŸŽ€ ARGUMENTS πŸŽ€

  • task β€” The target task. This is the task you're pointing at, bestie 🎯
  • hierarchy_id β€” The ID of a cgroup1 hierarchy. It tells you which cgroup1 hierarchy we're checking πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so on success, the cgroup is returen β€” yes, that's literally the spelling on the page, bestie 😭 β€” and it means you get the cgroup back. On failure, NULL is returned. That's the tea β˜•πŸ’€

πŸ’œ SEE ALSO πŸ’œ

Kernel file: ./kernel/bpf/helpers.c


Cute lil sign-off: source/version is ./kernel/bpf, date is October 2026, and this whole page is bpf_task_get_cgroup1(9) β€” periodt πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from