1 use nix::net::if_::*; 2 3 #[cfg(linux_android)] 4 const LOOPBACK: &[u8] = b"lo"; 5 6 #[cfg(not(any(linux_android, target_os = "haiku")))] 7 const LOOPBACK: &[u8] = b"lo0"; 8 9 #[cfg(target_os = "haiku")] 10 const LOOPBACK: &[u8] = b"loop"; 11 12 #[test] test_if_nametoindex()13fn test_if_nametoindex() { 14 if_nametoindex(LOOPBACK).expect("assertion failed"); 15 } 16