# Function cargo::util::hostname::hostname

source ·

    pub fn hostname() -> Result<OsString>

Expand description

Returns the hostname of the current system.

It is unusual, although technically possible, for this routine to return an error. It is difficult to list out the error conditions, but one such possibility is platform support.

## Platform specific behavior

On Unix, this returns the result of the `gethostname` function from the `libc` linked into the program.