def _register_process_with_cgrulesengd(pid):
    """Tell cgrulesengd daemon to not move the given process into other cgroups,
    if libcgroup is available.
    """
    from ctypes import cdll
    try:
        libcgroup = cdll.LoadLibrary('libcgroup.so.1')
        failure = libcgroup.cgroup_init()
        if failure:
            pass
        else:
            CGROUP_DAEMON_UNCHANGE_CHILDREN = 1
            failure = libcgroup.cgroup_register_unchanged_process(pid,
                CGROUP_DAEMON_UNCHANGE_CHILDREN)
            if failure:
                pass
    except OSError:
        pass
