Skip to content

Commit 49eea79

Browse files
wfdewithalexrp
authored andcommitted
std.os.linux: add pivot_root syscall
1 parent 5442e06 commit 49eea79

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/std/os/linux.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,10 @@ pub fn umount2(special: [*:0]const u8, flags: u32) usize {
968968
return syscall2(.umount2, @intFromPtr(special), flags);
969969
}
970970

971+
pub fn pivot_root(new_root: [*:0]const u8, put_old: [*:0]const u8) usize {
972+
return syscall2(.pivot_root, @intFromPtr(new_root), @intFromPtr(put_old));
973+
}
974+
971975
pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: MAP, fd: i32, offset: i64) usize {
972976
if (@hasField(SYS, "mmap2")) {
973977
return syscall6(

0 commit comments

Comments
 (0)