MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / main

Function main

examples/pivot_root.rs:4–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3#[cfg(all(target_os = "linux", feature = "fs", feature = "process"))]
4fn main() -> rustix::io::Result<()> {
5 let mut args = std::env::args();
6 if args.len() != 3 {
7 eprintln!("Usage: {} new_root put_old", args.next().unwrap());
8 std::process::exit(1);
9 }
10
11 let _argv0 = args.next().unwrap();
12 let new_root = args.next().unwrap();
13 let put_old = args.next().unwrap();
14
15 rustix::process::pivot_root(new_root, put_old)?;
16
17 Ok(())
18}
19
20#[cfg(any(
21 not(target_os = "linux"),

Callers

nothing calls this directly

Calls 3

pivot_rootFunction · 0.50
lenMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected