Skip to main content

libc/unix/linux_like/linux/gnu/b64/
mod.rs

1//! 64-bit specific definitions for linux-like values
2
3use crate::prelude::*;
4
5pub type ino_t = u64;
6pub type off_t = i64;
7pub type blkcnt_t = i64;
8pub type shmatt_t = u64;
9pub type msgqnum_t = u64;
10pub type msglen_t = u64;
11pub type fsblkcnt_t = u64;
12pub type fsfilcnt_t = u64;
13pub type rlim_t = u64;
14#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
15pub type __syscall_ulong_t = c_ulonglong;
16#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
17pub type __syscall_ulong_t = c_ulong;
18
19cfg_if! {
20    if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
21        pub type clock_t = i32;
22        pub type time_t = i32;
23        pub type __fsword_t = i32;
24    } else {
25        pub type __fsword_t = i64;
26        pub type clock_t = i64;
27        pub type time_t = i64;
28    }
29}
30
31#[automatically_derived]
#[allow(deprecated)]
impl ::core::clone::Clone for timex {
    #[inline]
    fn clone(&self) -> timex {
        let _: ::core::clone::AssertParamIsClone<c_uint>;
        let _: ::core::clone::AssertParamIsClone<c_long>;
        let _: ::core::clone::AssertParamIsClone<c_int>;
        let _: ::core::clone::AssertParamIsClone<crate::timeval>;
        let _: ::core::clone::AssertParamIsClone<i32>;
        *self
    }
}
#[automatically_derived]
#[allow(deprecated)]
impl ::core::marker::Copy for timex { }
#[automatically_derived]
#[allow(deprecated)]
impl ::core::fmt::Debug for timex {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            &["modes", "offset", "freq", "maxerror", "esterror", "status",
                        "constant", "precision", "tolerance", "time", "tick",
                        "ppsfreq", "jitter", "shift", "stabil", "jitcnt", "calcnt",
                        "errcnt", "stbcnt", "tai", "__unused1", "__unused2",
                        "__unused3", "__unused4", "__unused5", "__unused6",
                        "__unused7", "__unused8", "__unused9", "__unused10",
                        "__unused11"];
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.modes, &self.offset, &self.freq, &self.maxerror,
                        &self.esterror, &self.status, &self.constant,
                        &self.precision, &self.tolerance, &self.time, &self.tick,
                        &self.ppsfreq, &self.jitter, &self.shift, &self.stabil,
                        &self.jitcnt, &self.calcnt, &self.errcnt, &self.stbcnt,
                        &self.tai, &self.__unused1, &self.__unused2,
                        &self.__unused3, &self.__unused4, &self.__unused5,
                        &self.__unused6, &self.__unused7, &self.__unused8,
                        &self.__unused9, &self.__unused10, &&self.__unused11];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, "timex", names,
            values)
    }
}s! {
32    pub struct sigset_t {
33        #[cfg(target_pointer_width = "32")]
34        __val: [u32; 32],
35        #[cfg(target_pointer_width = "64")]
36        __val: [u64; 16],
37    }
38
39    pub struct sysinfo {
40        pub uptime: i64,
41        pub loads: [u64; 3],
42        pub totalram: u64,
43        pub freeram: u64,
44        pub sharedram: u64,
45        pub bufferram: u64,
46        pub totalswap: u64,
47        pub freeswap: u64,
48        pub procs: c_ushort,
49        pub pad: c_ushort,
50        pub totalhigh: u64,
51        pub freehigh: u64,
52        pub mem_unit: c_uint,
53        pub _f: [c_char; 0],
54    }
55
56    pub struct msqid_ds {
57        pub msg_perm: crate::ipc_perm,
58        pub msg_stime: crate::time_t,
59        pub msg_rtime: crate::time_t,
60        pub msg_ctime: crate::time_t,
61        pub __msg_cbytes: u64,
62        pub msg_qnum: crate::msgqnum_t,
63        pub msg_qbytes: crate::msglen_t,
64        pub msg_lspid: crate::pid_t,
65        pub msg_lrpid: crate::pid_t,
66        __glibc_reserved4: Padding<u64>,
67        __glibc_reserved5: Padding<u64>,
68    }
69
70    pub struct semid_ds {
71        pub sem_perm: ipc_perm,
72        pub sem_otime: crate::time_t,
73        #[cfg(not(any(
74            target_arch = "aarch64",
75            target_arch = "loongarch64",
76            target_arch = "mips64",
77            target_arch = "mips64r6",
78            target_arch = "powerpc64",
79            target_arch = "riscv64",
80            target_arch = "sparc64",
81            target_arch = "s390x",
82        )))]
83        __reserved: Padding<crate::__syscall_ulong_t>,
84        pub sem_ctime: crate::time_t,
85        #[cfg(not(any(
86            target_arch = "aarch64",
87            target_arch = "loongarch64",
88            target_arch = "mips64",
89            target_arch = "mips64r6",
90            target_arch = "powerpc64",
91            target_arch = "riscv64",
92            target_arch = "sparc64",
93            target_arch = "s390x",
94        )))]
95        __reserved2: Padding<crate::__syscall_ulong_t>,
96        pub sem_nsems: crate::__syscall_ulong_t,
97        __glibc_reserved3: Padding<crate::__syscall_ulong_t>,
98        __glibc_reserved4: Padding<crate::__syscall_ulong_t>,
99    }
100
101    // net/iucv/iucv.h
102
103    pub struct sockaddr_iucv {
104        pub siucv_family: crate::sa_family_t,
105        __siucv_port: Padding<u16>, // unused crate::in_port_t
106        __siucv_addr: Padding<u32>, // unused crate::in_addr_t
107        pub siucv_nodeid: [c_char; 8],
108        pub siucv_user_id: [c_char; 8],
109        pub siucv_name: [c_char; 8],
110    }
111
112    pub struct timex {
113        pub modes: c_uint,
114        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
115        pub offset: i64,
116        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
117        pub offset: c_long,
118        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
119        pub freq: i64,
120        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
121        pub freq: c_long,
122        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
123        pub maxerror: i64,
124        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
125        pub maxerror: c_long,
126        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
127        pub esterror: i64,
128        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
129        pub esterror: c_long,
130        pub status: c_int,
131        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
132        pub constant: i64,
133        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
134        pub constant: c_long,
135        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
136        pub precision: i64,
137        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
138        pub precision: c_long,
139        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
140        pub tolerance: i64,
141        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
142        pub tolerance: c_long,
143        pub time: crate::timeval,
144        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
145        pub tick: i64,
146        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
147        pub tick: c_long,
148        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
149        pub ppsfreq: i64,
150        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
151        pub ppsfreq: c_long,
152        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
153        pub jitter: i64,
154        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
155        pub jitter: c_long,
156        pub shift: c_int,
157        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
158        pub stabil: i64,
159        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
160        pub stabil: c_long,
161        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
162        pub jitcnt: i64,
163        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
164        pub jitcnt: c_long,
165        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
166        pub calcnt: i64,
167        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
168        pub calcnt: c_long,
169        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
170        pub errcnt: i64,
171        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
172        pub errcnt: c_long,
173        #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
174        pub stbcnt: i64,
175        #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
176        pub stbcnt: c_long,
177        pub tai: c_int,
178        pub __unused1: i32,
179        pub __unused2: i32,
180        pub __unused3: i32,
181        pub __unused4: i32,
182        pub __unused5: i32,
183        pub __unused6: i32,
184        pub __unused7: i32,
185        pub __unused8: i32,
186        pub __unused9: i32,
187        pub __unused10: i32,
188        pub __unused11: i32,
189    }
190}
191
192pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
193
194pub const O_LARGEFILE: c_int = 0;
195
196cfg_if! {
197    if #[cfg(target_arch = "aarch64")] {
198        mod aarch64;
199        pub use self::aarch64::*;
200    } else if #[cfg(any(target_arch = "powerpc64"))] {
201        mod powerpc64;
202        pub use self::powerpc64::*;
203    } else if #[cfg(any(target_arch = "sparc64"))] {
204        mod sparc64;
205        pub use self::sparc64::*;
206    } else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
207        mod mips64;
208        pub use self::mips64::*;
209    } else if #[cfg(any(target_arch = "s390x"))] {
210        mod s390x;
211        pub use self::s390x::*;
212    } else if #[cfg(target_arch = "x86_64")] {
213        mod x86_64;
214        pub use self::x86_64::*;
215    } else if #[cfg(any(target_arch = "riscv64"))] {
216        mod riscv64;
217        pub use self::riscv64::*;
218    } else if #[cfg(any(target_arch = "loongarch64"))] {
219        mod loongarch64;
220        pub use self::loongarch64::*;
221    } else {
222        // Unknown target_arch
223    }
224}