get_cgroup1_hierarchy_id(9)
π get_cgroup1_hierarchy_id(9) β a Kernel API Manual moment
okay so bestie, welcome to the <pink>get_cgroup1_hierarchy_id</pink> page, straight outta the Kernel API Manual. this one's a lil function that does exactly one thing and does it cute. let's get into it π
β¨ NAME β¨
get_cgroup1_hierarchy_id β gets you the ID of a cgroup1 hierarchy, and it pulls it straight from the cgroup1 subsys name. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
int get_cgroup1_hierarchy_id (const char *subsys_name );
literally one argument, one int back. she's low maintenance, we stan. β¨
π¦ ARGUMENTS π¦
subsys_nameβ the cgroup1 subsys name, and ngl you can grab this from/proc/self/cgroup. it can be a named cgroup like"name=systemd", or a controller name like"net_cls", or even multi-controllers like"net_cls,net_prio". so she's flexible, she's versatile, she contains multitudes π
π SEE ALSO π
like, go look at this kernel file, it's right there in the source:
- Kernel file
./tools/testing/selftests/bpf/cgroup_helpers.c
and the whole friend group of related functions, no cap:
enable_controllers(9)write_cgroup_file(9)write_cgroup_file_parent(9)setup_cgroup_environment(9)join_cgroup(9)join_root_cgroup(9)join_parent_cgroup(9)set_cgroup_xattr(9)__cleanup_cgroup_environment(9)cleanup_cgroup_environment(9)get_root_cgroup(9)create_and_get_cgroup(9)get_cgroup_id_from_path(9)setup_classid_environment(9)set_classid(9)join_classid(9)cleanup_classid_environment(9)get_classid_cgroup_id(9)open_classid(9)
fr fr, that's the whole page β no hidden options, no secret environment variables, no exit statuses hiding in the bushes. just subsys_name in, hierarchy ID out. π«Ά
and that's a wrap bestie!! this icon was brought to you by the <purple>./tools/testing/selftests/bpf</purple> section (iykyk), dated `October 2026. mwah, go read your kernel source, ily ππ§β
π¦ 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