Closed
Description
I'm doing a really quick experiment to try to invoke the uname
function on macOS. Following the documentation, I wrote the code below.
extern crate nix;
fn main() {
println!("Hello, world!");
let name = nix::sys::utsname::uname();
println!("
sysname = {}
nodename = {}
release = {}
version = {}
machine = {}
", name.sysname(), name.nodename(), name.release(), name.version(), name.machine());
}
My Cargo.toml
file points to version 0.8.1 of nix
as a dependency. When I try to compile this program with cargo build
I get the following error:
error[E0433]: failed to resolve. Could not find `utsname` in `sys`
--> src/main.rs:5:16
|
5 | let name = nix::sys::utsname::uname();
| ^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `utsname` in `sys`
I'm running this on macOS 10.12.4 with rustc 1.17.0.