MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / platform_host_name

Function platform_host_name

packages/server/src/config.rs:97–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95
96#[cfg(unix)]
97fn platform_host_name() -> Option<String> {
98 let mut buffer = [0 as libc::c_char; 256];
99 unsafe {
100 if libc::gethostname(buffer.as_mut_ptr(), buffer.len()) != 0 {
101 None
102 } else {
103 buffer[buffer.len() - 1] = 0;
104 CStr::from_ptr(buffer.as_ptr()).to_str().ok()
105 }
106 }
107 .map(ToOwned::to_owned)
108}
109
110#[cfg(not(unix))]
111fn platform_host_name() -> Option<String> {

Callers 1

local_host_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected