func (cg *Cgroup) AddController(name string) (Controller, error) { result := C.cgroup_add_controller(cg.g, C.CString(name)) if result == nil { return Controller{}, errors.New(fmt.Sprintf("Unable to add controller %s", name)) } return Controller{result}, nil }
// AddController attaches a new controller to cgroup. This function just // modifies internal libcgroup structure, not the kernel control group. func (cg *Cgroup) AddController(name string) *Controller { return &Controller{ C.cgroup_add_controller(cg.g, C.CString(name)), } }