diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index b04b15fe..118daf49 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -390,9 +390,15 @@ extern { pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; pub fn if_nameindex() -> *mut if_nameindex; pub fn if_freenameindex(ptr: *mut if_nameindex); + + #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly"))] + pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; + #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly"))] + pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; + #[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly")))] pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + #[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly")))] pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; - pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;