1 //! Tests for [`rustix::net`]. 2 3 #![cfg(feature = "net")] 4 #![cfg_attr(target_os = "wasi", feature(wasi_ext))] 5 #![cfg(not(any(target_os = "redox", target_os = "wasi")))] 6 #![cfg_attr(io_lifetimes_use_std, feature(io_safety))] 7 #![cfg_attr(core_c_str, feature(core_c_str))] 8 9 mod addr; 10 mod connect_bind_send; 11 mod poll; 12 mod sockopt; 13 #[cfg(unix)] 14 mod unix; 15 mod v4; 16 mod v6; 17 18 /// Windows requires us to call a setup function before using any of the 19 /// socket APIs. 20 #[cfg(windows)] 21 #[ctor::ctor] windows_startup()22fn windows_startup() { 23 let _ = rustix::net::wsa_startup().unwrap(); 24 } 25 26 /// Windows requires us to call a cleanup function after using any of the 27 /// socket APIs. 28 #[cfg(windows)] 29 #[ctor::dtor] windows_shutdown()30fn windows_shutdown() { 31 rustix::net::wsa_cleanup().unwrap(); 32 } 33