1use crate::arch::constant::ARCH;
4
5pub const UTS_NAME_LEN: usize = 65;
7
8#[repr(C)]
11#[derive(Debug, Clone, PartialEq, Eq)]
12pub struct UtsNamespace {
13 pub sysname: [u8; UTS_NAME_LEN],
15 pub nodename: [u8; UTS_NAME_LEN],
17 pub release: [u8; UTS_NAME_LEN],
19 pub version: [u8; UTS_NAME_LEN],
21 pub machine: [u8; UTS_NAME_LEN],
23 pub domainname: [u8; UTS_NAME_LEN],
25}
26
27impl Default for UtsNamespace {
28 fn default() -> Self {
38 Self {
39 nodename: {
40 let mut buf = [0u8; 65];
41 let bytes = "localhost".as_bytes();
42 buf[..bytes.len()].copy_from_slice(bytes);
43 buf
44 },
45 domainname: {
46 let mut buf = [0u8; 65];
47 let bytes = "localdomain".as_bytes();
48 buf[..bytes.len()].copy_from_slice(bytes);
49 buf
50 },
51 sysname: {
52 let mut buf = [0u8; 65];
53 let bytes = "ComixOS".as_bytes();
54 buf[..bytes.len()].copy_from_slice(bytes);
55 buf
56 },
57 release: {
58 let mut buf = [0u8; 65];
59 let bytes = "0.1.0".as_bytes();
60 buf[..bytes.len()].copy_from_slice(bytes);
61 buf
62 },
63 version: {
64 let mut buf = [0u8; 65];
65 let bytes = "Version 0.1.0".as_bytes();
66 buf[..bytes.len()].copy_from_slice(bytes);
67 buf
68 },
69 machine: {
70 let mut buf = [0u8; 65];
71 let bytes = ARCH.as_bytes();
72 buf[..bytes.len()].copy_from_slice(bytes);
73 buf
74 },
75 }
76 }
77}