Skip to main content

name

Function name 

Source
pub fn name() -> Result<String>
Expand description

The host name. A live reading: DHCP and hostnamectl change it while processes run. A name that is not UTF-8 is converted lossily, and one longer than 255 bytes is truncated (E-95).

The host name is an identifying value: keep it out of output that leaves the machine unless that is intended.

ยงErrors

NotFound or PermissionDenied when a sandbox hides it; Os when the system call fails.