18
18
//!
19
19
//! [Click here for Zenoh's documentation](https://docs.rs/zenoh/latest/zenoh)
20
20
mod adminspace;
21
- #[ cfg( unix ) ]
21
+ #[ cfg( target_os = "linux" ) ]
22
22
mod netlink;
23
23
pub mod orchestrator;
24
24
mod scouting;
25
25
26
26
#[ cfg( feature = "plugins" ) ]
27
27
use std:: sync:: { Mutex , MutexGuard } ;
28
+ #[ cfg( target_os = "linux" ) ]
29
+ use std:: time:: Duration ;
28
30
use std:: {
29
31
any:: Any ,
30
32
collections:: HashSet ,
@@ -33,12 +35,12 @@ use std::{
33
35
atomic:: { AtomicU32 , Ordering } ,
34
36
Arc , Weak ,
35
37
} ,
36
- time:: Duration ,
37
38
} ;
38
39
39
40
pub use adminspace:: AdminSpace ;
40
41
use async_trait:: async_trait;
41
42
use futures:: { stream:: StreamExt , Future } ;
43
+ #[ cfg( target_os = "linux" ) ]
42
44
use rtnetlink:: packet_route:: {
43
45
address:: { AddressAttribute , AddressMessage } ,
44
46
RouteNetlinkMessage ,
@@ -65,6 +67,7 @@ use zenoh_transport::{
65
67
multicast:: TransportMulticast , unicast:: TransportUnicast , TransportEventHandler ,
66
68
TransportManager , TransportMulticastEventHandler , TransportPeer , TransportPeerEventHandler ,
67
69
} ;
70
+ #[ cfg( target_os = "linux" ) ]
68
71
use zenoh_util:: net:: update_iface_cache;
69
72
70
73
use self :: orchestrator:: StartConditions ;
@@ -83,7 +86,7 @@ use crate::{
83
86
GIT_VERSION , LONG_VERSION ,
84
87
} ;
85
88
86
- #[ cfg( unix ) ]
89
+ #[ cfg( target_os = "linux" ) ]
87
90
const NETLINK_TIMEOUT : Duration = Duration :: from_millis ( 500 ) ;
88
91
89
92
pub ( crate ) struct RuntimeState {
@@ -256,7 +259,7 @@ impl RuntimeBuilder {
256
259
zenoh_config:: ShmInitMode :: Lazy => { }
257
260
} ;
258
261
259
- #[ cfg( unix ) ]
262
+ #[ cfg( target_os = "linux" ) ]
260
263
runtime. spawn ( {
261
264
let netlink_monitor = netlink:: NetlinkMonitor :: new ( ) ?;
262
265
let runtime2 = runtime. clone ( ) ;
@@ -390,7 +393,7 @@ impl Runtime {
390
393
self . state . pending_connections . lock ( ) . await . remove ( zid)
391
394
}
392
395
393
- #[ cfg( unix ) ]
396
+ #[ cfg( target_os = "linux" ) ]
394
397
async fn monitor_netlink_socket ( & self , mut netlink : netlink:: NetlinkMonitor ) {
395
398
fn add_addr_to_set (
396
399
message : & AddressMessage ,
0 commit comments