示例#1
0
// Set owner of the group control files and the @c tasks file. This function
// modifies only libcgroup internal cgroup structure, use
// Cgroup.Create() afterwards to create the group with given owners.
// @param cgroup
// @param tasks_uid UID of the owner of group's @c tasks file.
// @param tasks_gid GID of the owner of group's @c tasks file.
// @param control_uid UID of the owner of group's control files (i.e.
// parameters).
// @param control_gid GID of the owner of group's control files (i.e.
// parameters).
func (cg Cgroup) SetUidGid(tasks_uid UID, tasks_gid GID,
	control_uid UID, control_gid GID) error {
	return _err(C.cgroup_set_uid_gid(cg.g,
		C.uid_t(tasks_uid), C.gid_t(tasks_gid),
		C.uid_t(control_uid), C.gid_t(control_gid)))

}
示例#2
0
文件: cg.go 项目: vbatts/go-cgroup
/*
SetUIDGID sets owner of the group control files and the @c tasks file. This function
modifies only libcgroup internal cgroup structure, use
Cgroup.Create() afterwards to create the group with given owners.

@param cgroup
@param tasksUID UID of the owner of group's @c tasks file.
@param tasksGID GID of the owner of group's @c tasks file.
@param controlUID UID of the owner of group's control files (i.e.
parameters).
@param controlGID GID of the owner of group's control files (i.e.
parameters).
*/
func (cg Cgroup) SetUIDGID(tasksUID UID, tasksGID GID,
	controlUID UID, controlGID GID) error {
	return _err(C.cgroup_set_uid_gid(cg.g,
		C.uid_t(tasksUID), C.gid_t(tasksGID),
		C.uid_t(controlUID), C.gid_t(controlGID)))

}
示例#3
0
// Return owners of the group's @c tasks file and control files.
// The data is read from libcgroup internal cgroup structure, use
// Cgroup.SetUidGid() or Cgroup.Get() to fill it.
func (cg Cgroup) GetUidGid() (tasks_uid UID, tasks_gid GID, control_uid UID, control_gid GID, err error) {
	var (
		c_t_u C.uid_t
		c_t_g C.gid_t
		c_c_u C.uid_t
		c_c_g C.gid_t
	)
	err = _err(C.cgroup_set_uid_gid(cg.g,
		c_t_u,
		c_t_g,
		c_c_u,
		c_c_g))
	return UID(c_t_u), GID(c_t_g), UID(c_c_u), GID(c_c_g), err

}
示例#4
0
文件: cg.go 项目: vbatts/go-cgroup
// GetUIDGID returns owners of the group's @c tasks file and control files.
// The data is read from libcgroup internal cgroup structure, use
// Cgroup.SetUIDGID() or Cgroup.Get() to fill it.
func (cg Cgroup) GetUIDGID() (tasksUID UID, tasksGID GID, controlUID UID, controlGID GID, err error) {
	var (
		cTU C.uid_t
		cTG C.gid_t
		cCU C.uid_t
		cCG C.gid_t
	)
	err = _err(C.cgroup_set_uid_gid(cg.g,
		cTU,
		cTG,
		cCU,
		cCG))
	return UID(cTU), GID(cTG), UID(cCU), GID(cCG), err

}