stanislav-tkach / os_info

Rust library to detect the operating system type
MIT License
171 stars 52 forks source link

Try to use uname from nix or libc crates #375

Open stanislav-tkach opened 4 months ago

stanislav-tkach commented 4 months ago

Perhaps it would be better to use a function from one of these crates instead of invoking the uname process.

sunshowers commented 4 months ago

Sadly I learned that uname -o doesn't have a (portable?) programmatic API. Other uses of uname can probably be replaced though.

sunshowers commented 4 months ago

I did find https://docs.rs/platform-info/latest/platform_info/, which hardcodes the OS: https://docs.rs/platform-info/latest/src/platform_info/lib_impl.rs.html