3
3
use crate :: cmp;
4
4
use crate :: io:: { self , Initializer , IoSlice , IoSliceMut , Read } ;
5
5
use crate :: mem;
6
+ use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
6
7
use crate :: sys:: {
7
8
cvt,
8
9
net:: netc:: { self , c_int, c_void, ssize_t} ,
@@ -105,6 +106,7 @@ impl NetFileDesc {
105
106
#[ cfg( not( any(
106
107
target_env = "newlib" ,
107
108
target_os = "solaris" ,
109
+ target_os = "illumos" ,
108
110
target_os = "emscripten" ,
109
111
target_os = "fuchsia" ,
110
112
target_os = "l4re" ,
@@ -122,6 +124,7 @@ impl NetFileDesc {
122
124
any(
123
125
target_env = "newlib" ,
124
126
target_os = "solaris" ,
127
+ target_os = "illumos" ,
125
128
target_os = "emscripten" ,
126
129
target_os = "fuchsia" ,
127
130
target_os = "l4re" ,
@@ -150,8 +153,6 @@ impl NetFileDesc {
150
153
}
151
154
152
155
pub fn duplicate ( & self ) -> io:: Result < NetFileDesc > {
153
- use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
154
-
155
156
// We want to atomically duplicate this file descriptor and set the
156
157
// CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
157
158
// flag, however, isn't supported on older Linux kernels (earlier than
@@ -189,7 +190,7 @@ impl NetFileDesc {
189
190
make_filedesc ( fd) ?
190
191
} else {
191
192
NetFileDesc :: new ( fd)
192
- } )
193
+ } ) ;
193
194
}
194
195
Err ( ref e) if e. raw_os_error ( ) == Some ( netc:: EINVAL ) => {
195
196
TRY_CLOEXEC . store ( false , Ordering :: Relaxed ) ;
0 commit comments