|
31 | 31 | pub e_exit: u16
|
32 | 32 | }
|
33 | 33 |
|
34 |
| - pub struct utmpx { |
35 |
| - pub ut_name: [::c_char; 32], |
36 |
| - pub ut_id: [::c_char; 4], |
37 |
| - |
38 |
| - pub ut_line: [::c_char; 32], |
39 |
| - pub ut_host: [::c_char; 256], |
40 |
| - |
41 |
| - pub ut_unused: [u8; 16], |
42 |
| - pub ut_session: u16, |
43 |
| - pub ut_type: u16, |
44 |
| - pub ut_pid: ::pid_t, |
45 |
| - ut_exit: exit_status, |
46 |
| - ut_ss: ::sockaddr_storage, |
47 |
| - pub ut_tv: ::timeval, |
48 |
| - pub ut_unused2: [u8; 16], |
49 |
| - } |
50 |
| - |
51 | 34 | pub struct aiocb {
|
52 | 35 | pub aio_fildes: ::c_int,
|
53 | 36 | pub aio_offset: ::off_t,
|
|
60 | 43 | _aio_err: ::c_int
|
61 | 44 | }
|
62 | 45 |
|
63 |
| - pub struct dirent { |
64 |
| - pub d_fileno: ::ino_t, |
65 |
| - pub d_namlen: u16, |
66 |
| - pub d_type: u8, |
67 |
| - __unused1: u8, |
68 |
| - __unused2: u32, |
69 |
| - pub d_name: [::c_char; 256], |
70 |
| - } |
71 |
| - |
72 | 46 | pub struct uuid {
|
73 | 47 | pub time_low: u32,
|
74 | 48 | pub time_mid: u16,
|
|
120 | 94 | pub f_uid_uuid: ::uuid_t,
|
121 | 95 | }
|
122 | 96 |
|
123 |
| - pub struct statfs { |
124 |
| - pub f_bsize: ::c_long, |
125 |
| - pub f_iosize: ::c_long, |
126 |
| - pub f_blocks: ::c_long, |
127 |
| - pub f_bfree: ::c_long, |
128 |
| - pub f_bavail: ::c_long, |
129 |
| - pub f_files: ::c_long, |
130 |
| - pub f_ffree: ::c_long, |
131 |
| - pub f_fsid: ::fsid_t, |
132 |
| - pub f_owner: ::uid_t, |
133 |
| - pub f_type: ::int32_t, |
134 |
| - pub f_flags: ::int32_t, |
135 |
| - pub f_syncwrites: ::c_long, |
136 |
| - pub f_asyncwrites: ::c_long, |
137 |
| - pub f_fstypename: [::c_char; 16], |
138 |
| - pub f_mntonname: [::c_char; 90], |
139 |
| - pub f_syncreads: ::c_long, |
140 |
| - pub f_asyncreads: ::c_long, |
141 |
| - pub f_mntfromname: [::c_char; 90], |
142 |
| - } |
143 |
| - |
144 | 97 | pub struct stat {
|
145 | 98 | pub st_ino: ::ino_t,
|
146 | 99 | pub st_nlink: ::nlink_t,
|
@@ -223,6 +176,58 @@ s! {
|
223 | 176 | }
|
224 | 177 | }
|
225 | 178 |
|
| 179 | +s_no_extra_traits! { |
| 180 | + #[allow(missing_debug_implementations)] |
| 181 | + pub struct utmpx { |
| 182 | + pub ut_name: [::c_char; 32], |
| 183 | + pub ut_id: [::c_char; 4], |
| 184 | + |
| 185 | + pub ut_line: [::c_char; 32], |
| 186 | + pub ut_host: [::c_char; 256], |
| 187 | + |
| 188 | + pub ut_unused: [u8; 16], |
| 189 | + pub ut_session: u16, |
| 190 | + pub ut_type: u16, |
| 191 | + pub ut_pid: ::pid_t, |
| 192 | + ut_exit: exit_status, |
| 193 | + ut_ss: ::sockaddr_storage, |
| 194 | + pub ut_tv: ::timeval, |
| 195 | + pub ut_unused2: [u8; 16], |
| 196 | + } |
| 197 | + |
| 198 | + #[allow(missing_debug_implementations)] |
| 199 | + pub struct dirent { |
| 200 | + pub d_fileno: ::ino_t, |
| 201 | + pub d_namlen: u16, |
| 202 | + pub d_type: u8, |
| 203 | + __unused1: u8, |
| 204 | + __unused2: u32, |
| 205 | + pub d_name: [::c_char; 256], |
| 206 | + } |
| 207 | + |
| 208 | + #[allow(missing_debug_implementations)] |
| 209 | + pub struct statfs { |
| 210 | + pub f_bsize: ::c_long, |
| 211 | + pub f_iosize: ::c_long, |
| 212 | + pub f_blocks: ::c_long, |
| 213 | + pub f_bfree: ::c_long, |
| 214 | + pub f_bavail: ::c_long, |
| 215 | + pub f_files: ::c_long, |
| 216 | + pub f_ffree: ::c_long, |
| 217 | + pub f_fsid: ::fsid_t, |
| 218 | + pub f_owner: ::uid_t, |
| 219 | + pub f_type: ::int32_t, |
| 220 | + pub f_flags: ::int32_t, |
| 221 | + pub f_syncwrites: ::c_long, |
| 222 | + pub f_asyncwrites: ::c_long, |
| 223 | + pub f_fstypename: [::c_char; 16], |
| 224 | + pub f_mntonname: [::c_char; 90], |
| 225 | + pub f_syncreads: ::c_long, |
| 226 | + pub f_asyncreads: ::c_long, |
| 227 | + pub f_mntfromname: [::c_char; 90], |
| 228 | + } |
| 229 | +} |
| 230 | + |
226 | 231 | pub const RAND_MAX: ::c_int = 0x7fff_ffff;
|
227 | 232 | pub const PTHREAD_STACK_MIN: ::size_t = 16384;
|
228 | 233 | pub const SIGSTKSZ: ::size_t = 40960;
|
@@ -804,26 +809,28 @@ f! {
|
804 | 809 | }
|
805 | 810 |
|
806 | 811 | pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
|
807 |
| - _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize |
| 812 | + (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize) |
| 813 | + as ::c_uint |
808 | 814 | }
|
809 | 815 |
|
810 | 816 | pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
|
811 | 817 | -> *mut ::cmsghdr
|
812 | 818 | {
|
813 |
| - let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len) |
| 819 | + let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize) |
814 | 820 | + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
|
815 | 821 | let max = (*mhdr).msg_control as usize
|
816 | 822 | + (*mhdr).msg_controllen as usize;
|
817 | 823 | if next <= max {
|
818 |
| - (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len)) as *mut ::cmsghdr |
| 824 | + (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)) |
| 825 | + as *mut ::cmsghdr |
819 | 826 | } else {
|
820 | 827 | 0 as *mut ::cmsghdr
|
821 | 828 | }
|
822 | 829 | }
|
823 | 830 |
|
824 | 831 | pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
|
825 |
| - _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + |
826 |
| - _CMSG_ALIGN(length as usize) |
| 832 | + (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + |
| 833 | + _CMSG_ALIGN(length as usize)) as ::c_uint |
827 | 834 | }
|
828 | 835 | }
|
829 | 836 |
|
|
0 commit comments