boxxy 0.14.0

Linkable sandbox explorer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::errors::*;
use libc::gid_t;

/// Set the supplemental groups.
///
/// ```no_run
/// boxxy::ffi::setgroups(&[1,2,3]).unwrap();
/// ```
pub fn setgroups(groups: &[gid_t]) -> Result<()> {
    let ret = unsafe { libc::setgroups(groups.len() as i32, groups.as_ptr()) };

    if ret < 0 {
        Err(errno())
    } else {
        Ok(())
    }
}