pub fn sys_unshare (flags: i32) -> i32 {
unsafe {
libc::unshare(flags)
}
}
pub fn sys_chroot(path: &str) -> i32 {
let mut path = path.to_owned();
path.push('\0');
let path = (*path).as_ptr() as *const i8;
unsafe {
libc::chroot(path)
}
}
pub fn sys_pivot_root(newroot: &str, oldroot_mnt_point: &str) -> i32 {
let mut newroot = newroot.to_owned();
let mut oldroot_mnt_point = oldroot_mnt_point.to_owned();
newroot.push('\0');
oldroot_mnt_point.push('\0');
unsafe {
libc::syscall(libc::SYS_pivot_root, newroot.as_ptr() as *const u8, oldroot_mnt_point.as_ptr() as *const u8) as i32
}
}