Lines Matching defs:groups

326 /// is specified, then the pid of the calling process is used.  Process groups
1520 // First get the maximum number of groups. The value returned
1528 // Next, get the number of groups so we can size our Vec
1531 // If there are no supplementary groups, return early.
1532 // This prevents a potential buffer over-read if the number of groups
1534 // number of groups beyond the capacity of the buffer.
1539 // Now actually get the groups. We try multiple times in case the number of
1540 // groups has changed since the first call to getgroups() and the buffer is
1542 let mut groups = Vec::<Gid>::with_capacity(Errno::result(ngroups)? as usize);
1548 libc::getgroups(groups.capacity() as c_int, groups.as_mut_ptr() as *mut gid_t)
1553 unsafe { groups.set_len(s as usize) };
1554 return Ok(groups);
1559 reserve_double_buffer_size(&mut groups, ngroups_max)
1599 pub fn setgroups(groups: &[Gid]) -> Result<()> {
1618 libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t)
1626 /// Gets the group IDs of all groups that `user` is a member of. The additional
1639 /// error of `EINVAL` if the number of groups to be fetched exceeds the
1642 /// partial list of groups when `NGROUPS_MAX` is exceeded, this implementation
1654 let mut groups = Vec::<Gid>::with_capacity(min(ngroups_max, 8) as usize);
1664 let mut ngroups = groups.capacity() as i32;
1668 groups.as_mut_ptr() as *mut getgrouplist_group_t,
1674 unsafe { groups.set_len(ngroups as usize) };
1675 return Ok(groups);
1678 // BSD systems will still fill the groups buffer with as many
1679 // groups as possible, but Linux manpages do not mention this
1681 reserve_double_buffer_size(&mut groups, ngroups_max as usize)
1689 /// Sets the supplementary group IDs for the calling process using all groups