bpf: Add bpf_current_task_under_cgroup helper
[muen/linux.git] / include / uapi / linux / bpf.h
index da218fec605657ee415f8ad71a95d8851330a9de..bea0c4e2830a48a3596a2d70de234824e59d0e35 100644 (file)
@@ -375,6 +375,17 @@ enum bpf_func_id {
         */
        BPF_FUNC_probe_write_user,
 
+       /**
+        * bpf_current_task_under_cgroup(map, index) - Check cgroup2 membership of current task
+        * @map: pointer to bpf_map in BPF_MAP_TYPE_CGROUP_ARRAY type
+        * @index: index of the cgroup in the bpf_map
+        * Return:
+        *   == 0 current failed the cgroup2 descendant test
+        *   == 1 current succeeded the cgroup2 descendant test
+        *    < 0 error
+        */
+       BPF_FUNC_current_task_under_cgroup,
+
        __BPF_FUNC_MAX_ID,
 };