mirror of
https://github.com/jiangcuo/nix.git
synced 2025-08-24 05:06:47 +00:00
16 lines
319 B
Rust
16 lines
319 B
Rust
use nix::net::if_::*;
|
|
|
|
#[cfg(linux_android)]
|
|
const LOOPBACK: &[u8] = b"lo";
|
|
|
|
#[cfg(not(any(linux_android, target_os = "haiku")))]
|
|
const LOOPBACK: &[u8] = b"lo0";
|
|
|
|
#[cfg(target_os = "haiku")]
|
|
const LOOPBACK: &[u8] = b"loop";
|
|
|
|
#[test]
|
|
fn test_if_nametoindex() {
|
|
if_nametoindex(LOOPBACK).expect("assertion failed");
|
|
}
|