remove gethosname, use proper types depending on bsd flavour

This commit is contained in:
gnzlbg 2018-01-18 17:02:07 +01:00
parent dca8a31d00
commit 7c074b85d4

View File

@ -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;