Пример #1
0
def cgroup_name(cgrp: Object) -> bytes:
    """
    Get the name of the given cgroup.

    :param cgrp: ``struct cgroup *``
    """
    return kernfs_name(cgrp.kn)
Пример #2
0
def cgroup_name(cgrp):
    """
    .. c:function:: char *cgroup_name(struct cgroup *cgrp)

    Get the name of the given cgroup.

    :rtype: bytes
    """
    return kernfs_name(cgrp.kn)
Пример #3
0
 def test_kernfs_name(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_name(kn), b"vmcoreinfo")