forked from mirrors/gecko-dev
We also artificially update nix to 0.25 in preparation for bug 1793784. Differential Revision: https://phabricator.services.mozilla.com/D164165
19 lines
396 B
Rust
19 lines
396 B
Rust
use nix::net::if_::*;
|
|
|
|
#[cfg(any(target_os = "android", target_os = "linux"))]
|
|
const LOOPBACK: &[u8] = b"lo";
|
|
|
|
#[cfg(not(any(
|
|
target_os = "android",
|
|
target_os = "linux",
|
|
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");
|
|
}
|