def cgroup_path(cgrp: Object) -> bytes: """ Get the full path of the given cgroup. :param cgrp: ``struct cgroup *`` """ return kernfs_path(cgrp.kn)
def cgroup_path(cgrp): """ .. c:function:: char *cgroup_path(struct cgroup *cgrp) Get the full path of the given cgroup. :rtype: bytes """ return kernfs_path(cgrp.kn)
def test_kernfs_path(self): with open("/sys/kernel/vmcoreinfo", "r") as f: file = fget(find_task(self.prog, os.getpid()), f.fileno()) kn = cast("struct kernfs_node *", file.f_inode.i_private) self.assertEqual(kernfs_path(kn), b"/kernel/vmcoreinfo")