mirror of
https://github.com/jiangcuo/nix.git
synced 2026-01-21 20:52:55 +00:00
13 lines
254 B
Rust
13 lines
254 B
Rust
use nix::net::if_::*;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
const LOOPBACK: &'static [u8] = b"lo";
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
const LOOPBACK: &'static [u8] = b"lo0";
|
|
|
|
#[test]
|
|
fn test_if_nametoindex() {
|
|
assert!(if_nametoindex(&LOOPBACK[..]).is_ok());
|
|
}
|