mod.rs 558 B

123456789101112131415161718192021
  1. //! sys/utsname implementation, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html
  2. use platform::{Pal, Sys};
  3. use platform::types::*;
  4. pub const UTSLENGTH: usize = 65;
  5. #[repr(C)]
  6. pub struct utsname {
  7. pub sysname: [c_char; UTSLENGTH],
  8. pub nodename: [c_char; UTSLENGTH],
  9. pub release: [c_char; UTSLENGTH],
  10. pub version: [c_char; UTSLENGTH],
  11. pub machine: [c_char; UTSLENGTH],
  12. pub domainname: [c_char; UTSLENGTH],
  13. }
  14. #[no_mangle]
  15. pub unsafe extern "C" fn uname(uts: *mut utsname) -> c_int {
  16. Sys::uname(uts)
  17. }