Skip to main content

sethostname

Function sethostname 

Source
pub fn sethostname(hostname: &[u8]) -> Result<()>
Expand description

Set the system’s hostname from its filesystem-encoded bytes.

socketmodule.c socket_sethostname reads the argument as a buffer and passes buf.buf/buf.len straight to the syscall, so a name is not required to be UTF-8; taking &[u8] keeps that true here as well.