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

Function main

crates/test-programs/src/bin/p1_path_open_read_write.rs:156–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156fn main() {
157 let mut args = env::args();
158 let prog = args.next().unwrap();
159 let arg = if let Some(arg) = args.next() {
160 arg
161 } else {
162 eprintln!("usage: {prog} <scratch directory>");
163 process::exit(1);
164 };
165
166 // Open scratch directory
167 let dir_fd = match open_scratch_directory(&arg) {
168 Ok(dir_fd) => dir_fd,
169 Err(err) => {
170 eprintln!("{err}");
171 process::exit(1)
172 }
173 };
174
175 // Run the tests.
176 unsafe {
177 test_path_open_read_write(dir_fd, BlockingMode::Blocking);
178 test_path_open_read_write(dir_fd, BlockingMode::NonBlocking);
179 }
180}

Callers

nothing calls this directly

Calls 4

open_scratch_directoryFunction · 0.85
unwrapMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected