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