Function uapi::gethostname

source ·
pub fn gethostname<T: Pod + ?Sized>(buf: &mut T) -> Result<&CStr>
Expand description

gethostname(2)

This function returns libc::ENAMETOOLONG if the hostname does not fit in the supplied buffer. If the hostname is longer than 255 bytes (excluding the nul byte), then this function always returns libc::ENAMETOOLONG.