예제 #1
0
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
}
예제 #2
0
파일: cg.go 프로젝트: vbatts/go-cgroup
// 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)),
	}
}