コード例 #1
0
ファイル: cgroup.go プロジェクト: NodePrime/open-mininet
/*
Stores given file permissions of the group's control and tasks files
into the cgroup data structure. Use NO_PERMS if permissions shouldn't
be changed or a value which applicable to chmod(2). Please note that
the given permissions are masked with the file owner's permissions.
For example if a control file has permissions 640 and control_fperm is
471 the result will be 460.

control_dperm Directory permission for the group.
control_fperm File permission for the control files.
task_fperm File permissions for task file.

  g := cgroup.NewCgroup("foo")
  g.SetPermissions(cgroup.Mode(0777), cgroup.Mode(0777), cgroup.Mode(0777))
*/
func (cg Cgroup) SetPermissions(control_dperm, control_fperm, task_fperm Mode) {
	C.cgroup_set_permissions(cg.g, C.mode_t(control_dperm),
		C.mode_t(control_fperm), C.mode_t(task_fperm))
}
コード例 #2
0
ファイル: cg.go プロジェクト: vbatts/go-cgroup
/*
SetPermissions stores given file permissions of the group's control and tasks files
into the cgroup data structure. Use NoPerms if permissions shouldn't
be changed or a value which applicable to chmod(2). Please note that
the given permissions are masked with the file owner's permissions.
For example if a control file has permissions 640 and controlFilePerm is
471 the result will be 460.

controlDirPerm Directory permission for the group.
controlFilePerm File permission for the control files.
taskFilePerm File permissions for task file.

  g := cgroup.NewCgroup("foo")
  g.SetPermissions(cgroup.Mode(0777), cgroup.Mode(0777), cgroup.Mode(0777))
*/
func (cg Cgroup) SetPermissions(controlDirPerm, controlFilePerm, taskFilePerm Mode) {
	C.cgroup_set_permissions(cg.g, C.mode_t(controlDirPerm),
		C.mode_t(controlFilePerm), C.mode_t(taskFilePerm))
}