diff options
Diffstat (limited to 'third_party/libc/src/unix/notbsd/linux/other/b32/mod.rs')
-rw-r--r-- | third_party/libc/src/unix/notbsd/linux/other/b32/mod.rs | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/third_party/libc/src/unix/notbsd/linux/other/b32/mod.rs b/third_party/libc/src/unix/notbsd/linux/other/b32/mod.rs new file mode 100644 index 0000000..ba48d63 --- /dev/null +++ b/third_party/libc/src/unix/notbsd/linux/other/b32/mod.rs | |||
@@ -0,0 +1,113 @@ | |||
1 | //! 32-bit specific definitions for linux-like values | ||
2 | |||
3 | pub type c_long = i32; | ||
4 | pub type c_ulong = u32; | ||
5 | pub type clock_t = i32; | ||
6 | pub type time_t = i32; | ||
7 | pub type suseconds_t = i32; | ||
8 | pub type ino_t = u32; | ||
9 | pub type off_t = i32; | ||
10 | pub type blkcnt_t = i32; | ||
11 | pub type __fsword_t = i32; | ||
12 | |||
13 | pub type blksize_t = i32; | ||
14 | pub type nlink_t = u32; | ||
15 | |||
16 | s! { | ||
17 | pub struct stat { | ||
18 | pub st_dev: ::dev_t, | ||
19 | __pad1: ::c_short, | ||
20 | pub st_ino: ::ino_t, | ||
21 | pub st_mode: ::mode_t, | ||
22 | pub st_nlink: ::nlink_t, | ||
23 | pub st_uid: ::uid_t, | ||
24 | pub st_gid: ::gid_t, | ||
25 | pub st_rdev: ::dev_t, | ||
26 | __pad2: ::c_short, | ||
27 | pub st_size: ::off_t, | ||
28 | pub st_blksize: ::blksize_t, | ||
29 | pub st_blocks: ::blkcnt_t, | ||
30 | pub st_atime: ::time_t, | ||
31 | pub st_atime_nsec: ::c_long, | ||
32 | pub st_mtime: ::time_t, | ||
33 | pub st_mtime_nsec: ::c_long, | ||
34 | pub st_ctime: ::time_t, | ||
35 | pub st_ctime_nsec: ::c_long, | ||
36 | __unused4: ::c_long, | ||
37 | __unused5: ::c_long, | ||
38 | } | ||
39 | |||
40 | pub struct stat64 { | ||
41 | pub st_dev: ::dev_t, | ||
42 | __pad1: ::c_uint, | ||
43 | __st_ino: ::ino_t, | ||
44 | pub st_mode: ::mode_t, | ||
45 | pub st_nlink: ::nlink_t, | ||
46 | pub st_uid: ::uid_t, | ||
47 | pub st_gid: ::gid_t, | ||
48 | pub st_rdev: ::dev_t, | ||
49 | __pad2: ::c_uint, | ||
50 | pub st_size: ::off64_t, | ||
51 | pub st_blksize: ::blksize_t, | ||
52 | pub st_blocks: ::blkcnt64_t, | ||
53 | pub st_atime: ::time_t, | ||
54 | pub st_atime_nsec: ::c_long, | ||
55 | pub st_mtime: ::time_t, | ||
56 | pub st_mtime_nsec: ::c_long, | ||
57 | pub st_ctime: ::time_t, | ||
58 | pub st_ctime_nsec: ::c_long, | ||
59 | pub st_ino: ::ino64_t, | ||
60 | } | ||
61 | |||
62 | pub struct pthread_attr_t { | ||
63 | __size: [u32; 9] | ||
64 | } | ||
65 | |||
66 | pub struct sigset_t { | ||
67 | __val: [::c_ulong; 32], | ||
68 | } | ||
69 | |||
70 | pub struct sysinfo { | ||
71 | pub uptime: ::c_long, | ||
72 | pub loads: [::c_ulong; 3], | ||
73 | pub totalram: ::c_ulong, | ||
74 | pub freeram: ::c_ulong, | ||
75 | pub sharedram: ::c_ulong, | ||
76 | pub bufferram: ::c_ulong, | ||
77 | pub totalswap: ::c_ulong, | ||
78 | pub freeswap: ::c_ulong, | ||
79 | pub procs: ::c_ushort, | ||
80 | pub pad: ::c_ushort, | ||
81 | pub totalhigh: ::c_ulong, | ||
82 | pub freehigh: ::c_ulong, | ||
83 | pub mem_unit: ::c_uint, | ||
84 | pub _f: [::c_char; 8], | ||
85 | } | ||
86 | } | ||
87 | |||
88 | pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; | ||
89 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; | ||
90 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; | ||
91 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; | ||
92 | |||
93 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | ||
94 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | ||
95 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | ||
96 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | ||
97 | pub const PTRACE_GETREGS: ::c_uint = 12; | ||
98 | pub const PTRACE_SETREGS: ::c_uint = 13; | ||
99 | |||
100 | cfg_if! { | ||
101 | if #[cfg(target_arch = "x86")] { | ||
102 | mod x86; | ||
103 | pub use self::x86::*; | ||
104 | } else if #[cfg(target_arch = "arm")] { | ||
105 | mod arm; | ||
106 | pub use self::arm::*; | ||
107 | } else if #[cfg(target_arch = "powerpc")] { | ||
108 | mod powerpc; | ||
109 | pub use self::powerpc::*; | ||
110 | } else { | ||
111 | // Unknown target_arch | ||
112 | } | ||
113 | } | ||