|
1 | 1 | use crate::off_t;
|
2 | 2 | use crate::prelude::*;
|
3 | 3 |
|
| 4 | +// Define lock_data_instrumented as an empty enum |
| 5 | +missing! { |
| 6 | + #[cfg_attr(feature = "extra_traits", derive(Debug))] |
| 7 | + pub enum lock_data_instrumented {} |
| 8 | +} |
| 9 | + |
4 | 10 | s! {
|
5 | 11 | pub struct sigset_t {
|
6 | 12 | pub ss_set: [c_ulong; 4],
|
@@ -256,6 +262,74 @@ s_no_extra_traits! {
|
256 | 262 | pub __pad: [c_int; 3],
|
257 | 263 | }
|
258 | 264 |
|
| 265 | + pub union _kernel_simple_lock { |
| 266 | + pub _slock: c_long, |
| 267 | + pub _slockp: *mut lock_data_instrumented, |
| 268 | + } |
| 269 | + |
| 270 | + pub struct fileops_t { |
| 271 | + pub fo_rw: Option< |
| 272 | + extern "C" fn( |
| 273 | + file: *mut file, |
| 274 | + rw: crate::uio_rw, |
| 275 | + io: *mut c_void, |
| 276 | + ext: c_long, |
| 277 | + secattr: *mut c_void, |
| 278 | + ) -> c_int, |
| 279 | + >, |
| 280 | + pub fo_ioctl: Option< |
| 281 | + extern "C" fn( |
| 282 | + file: *mut file, |
| 283 | + a: c_long, |
| 284 | + b: crate::caddr_t, |
| 285 | + c: c_long, |
| 286 | + d: c_long, |
| 287 | + ) -> c_int, |
| 288 | + >, |
| 289 | + pub fo_select: Option< |
| 290 | + extern "C" fn(file: *mut file, a: c_int, b: *mut c_ushort, c: extern "C" fn()) -> c_int, |
| 291 | + >, |
| 292 | + pub fo_close: Option<extern "C" fn(file: *mut file) -> c_int>, |
| 293 | + pub fo_fstat: Option<extern "C" fn(file: *mut file, sstat: *mut crate::stat) -> c_int>, |
| 294 | + } |
| 295 | + |
| 296 | + pub struct file { |
| 297 | + pub f_flag: c_long, |
| 298 | + pub f_count: c_int, |
| 299 | + pub f_options: c_short, |
| 300 | + pub f_type: c_short, |
| 301 | + // Should be pointer to 'vnode' |
| 302 | + pub f_data: *mut c_void, |
| 303 | + pub f_offset: c_longlong, |
| 304 | + pub f_dir_off: c_long, |
| 305 | + // Should be pointer to 'cred' |
| 306 | + pub f_cred: *mut c_void, |
| 307 | + pub f_lock: _kernel_simple_lock, |
| 308 | + pub f_offset_lock: _kernel_simple_lock, |
| 309 | + pub f_vinfo: crate::caddr_t, |
| 310 | + pub f_ops: *mut fileops_t, |
| 311 | + pub f_parentp: crate::caddr_t, |
| 312 | + pub f_fnamep: crate::caddr_t, |
| 313 | + pub f_fdata: [c_char; 160], |
| 314 | + } |
| 315 | + |
| 316 | + pub union __ld_info_file { |
| 317 | + pub _ldinfo_fd: c_int, |
| 318 | + pub _ldinfo_fp: *mut file, |
| 319 | + pub _core_offset: c_long, |
| 320 | + } |
| 321 | + |
| 322 | + pub struct ld_info { |
| 323 | + pub ldinfo_next: c_uint, |
| 324 | + pub ldinfo_flags: c_uint, |
| 325 | + pub _file: __ld_info_file, |
| 326 | + pub ldinfo_textorg: *mut c_void, |
| 327 | + pub ldinfo_textsize: c_ulong, |
| 328 | + pub ldinfo_dataorg: *mut c_void, |
| 329 | + pub ldinfo_datasize: c_ulong, |
| 330 | + pub ldinfo_filename: [c_char; 2], |
| 331 | + } |
| 332 | + |
259 | 333 | pub union __pollfd_ext_u {
|
260 | 334 | pub addr: *mut c_void,
|
261 | 335 | pub data32: u32,
|
@@ -327,6 +401,7 @@ cfg_if! {
|
327 | 401 | self.__si_flags.hash(state);
|
328 | 402 | }
|
329 | 403 | }
|
| 404 | + |
330 | 405 | impl PartialEq for __pollfd_ext_u {
|
331 | 406 | fn eq(&self, other: &__pollfd_ext_u) -> bool {
|
332 | 407 | unsafe {
|
|
0 commit comments