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

Function test_close_file

tests/io/close.rs:5–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3#[cfg(any(unix, target_os = "wasi"))]
4#[test]
5fn test_close_file() {
6 let file = std::fs::File::open("Cargo.toml").unwrap();
7 let raw = file.into_raw_fd();
8 unsafe {
9 rustix::io::close(raw);
10 }
11}
12
13#[test]
14fn test_close_socket() {

Callers

nothing calls this directly

Calls 3

openFunction · 0.50
closeFunction · 0.50
into_raw_fdMethod · 0.45

Tested by

no test coverage detected