We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f65390 commit 05a3a82Copy full SHA for 05a3a82
tests/socket.rs
@@ -63,6 +63,24 @@ fn set_cloexec() {
63
assert_close_on_exec(&socket, false);
64
}
65
66
+#[cfg(all(
67
+ feature = "all",
68
+ any(
69
+ target_os = "android",
70
+ target_os = "dragonfly",
71
+ target_os = "freebsd",
72
+ target_os = "linux",
73
+ target_os = "netbsd",
74
+ target_os = "openbsd"
75
+ )
76
+))]
77
+#[test]
78
+fn type_cloexec() {
79
+ let ty = Type::Stream.cloexec();
80
+ let socket = Socket::new(Domain::IPV4, ty, None).unwrap();
81
+ assert_close_on_exec(&socket, true);
82
+}
83
+
84
/// Assert that `CLOEXEC` is set on `socket`.
85
#[cfg(unix)]
86
pub fn assert_close_on_exec<S>(socket: &S, want: bool)
0 commit comments