33use crate :: cmp;
44use crate :: io:: { self , Initializer , IoSlice , IoSliceMut , Read } ;
55use crate :: mem;
6+ use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
67use crate :: sys:: {
78 cvt,
89 net:: netc:: { self , c_int, c_void, ssize_t} ,
@@ -105,6 +106,7 @@ impl NetFileDesc {
105106 #[ cfg( not( any(
106107 target_env = "newlib" ,
107108 target_os = "solaris" ,
109+ target_os = "illumos" ,
108110 target_os = "emscripten" ,
109111 target_os = "fuchsia" ,
110112 target_os = "l4re" ,
@@ -122,6 +124,7 @@ impl NetFileDesc {
122124 any(
123125 target_env = "newlib" ,
124126 target_os = "solaris" ,
127+ target_os = "illumos" ,
125128 target_os = "emscripten" ,
126129 target_os = "fuchsia" ,
127130 target_os = "l4re" ,
@@ -150,8 +153,6 @@ impl NetFileDesc {
150153 }
151154
152155 pub fn duplicate ( & self ) -> io:: Result < NetFileDesc > {
153- use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
154-
155156 // We want to atomically duplicate this file descriptor and set the
156157 // CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
157158 // flag, however, isn't supported on older Linux kernels (earlier than
@@ -189,7 +190,7 @@ impl NetFileDesc {
189190 make_filedesc ( fd) ?
190191 } else {
191192 NetFileDesc :: new ( fd)
192- } )
193+ } ) ;
193194 }
194195 Err ( ref e) if e. raw_os_error ( ) == Some ( netc:: EINVAL ) => {
195196 TRY_CLOEXEC . store ( false , Ordering :: Relaxed ) ;
0 commit comments