]>
Commit | Line | Data |
---|---|---|
92a42be0 SL |
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; | |
9cc50fc6 | 11 | pub type __fsword_t = i32; |
92a42be0 SL |
12 | |
13 | pub type blksize_t = i32; | |
14 | pub type nlink_t = u32; | |
15 | ||
92a42be0 SL |
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 | ||
54a0048b SL |
71 | pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; |
72 | pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; | |
73 | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; | |
74 | ||
75 | pub const PTRACE_GETFPREGS: ::c_uint = 14; | |
76 | pub const PTRACE_SETFPREGS: ::c_uint = 15; | |
77 | pub const PTRACE_GETFPXREGS: ::c_uint = 18; | |
78 | pub const PTRACE_SETFPXREGS: ::c_uint = 19; | |
79 | pub const PTRACE_GETREGS: ::c_uint = 12; | |
80 | pub const PTRACE_SETREGS: ::c_uint = 13; | |
81 | ||
92a42be0 SL |
82 | cfg_if! { |
83 | if #[cfg(target_arch = "x86")] { | |
84 | mod x86; | |
85 | pub use self::x86::*; | |
86 | } else if #[cfg(target_arch = "arm")] { | |
87 | mod arm; | |
88 | pub use self::arm::*; | |
7453a54e SL |
89 | } else if #[cfg(target_arch = "powerpc")] { |
90 | mod powerpc; | |
91 | pub use self::powerpc::*; | |
92a42be0 | 92 | } else { |
54a0048b | 93 | // Unknown target_arch |
92a42be0 SL |
94 | } |
95 | } |