|
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,69 @@ 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<extern "C" fn( |
| 272 | + file: *mut file, |
| 273 | + rw: crate::uio_rw, |
| 274 | + io: *mut c_void, |
| 275 | + ext: c_long, |
| 276 | + secattr: *mut c_void, |
| 277 | + ) -> c_int>, |
| 278 | + pub fo_ioctl: Option<extern "C" fn( |
| 279 | + file: *mut file, |
| 280 | + a: c_long, |
| 281 | + b: crate::caddr_t, |
| 282 | + c: c_long, |
| 283 | + d: c_long, |
| 284 | + ) -> c_int>, |
| 285 | + pub fo_select: |
| 286 | + Option<extern "C" fn(file: *mut file, a: c_int, b: *mut c_ushort, c: extern "C" fn()) -> c_int>, |
| 287 | + pub fo_close: Option<extern "C" fn(file: *mut file) -> c_int>, |
| 288 | + pub fo_fstat: Option<extern "C" fn(file: *mut file, sstat: *mut crate::stat) -> c_int>, |
| 289 | + } |
| 290 | + |
| 291 | + pub struct file { |
| 292 | + pub f_flag: c_long, |
| 293 | + pub f_count: c_int, |
| 294 | + pub f_options: c_short, |
| 295 | + pub f_type: c_short, |
| 296 | + // Should be pointer to 'vnode' |
| 297 | + pub f_data: *mut c_void, |
| 298 | + pub f_offset: c_longlong, |
| 299 | + pub f_dir_off: c_long, |
| 300 | + // Should be pointer to 'cred' |
| 301 | + pub f_cred: *mut c_void, |
| 302 | + pub f_lock: _kernel_simple_lock, |
| 303 | + pub f_offset_lock: _kernel_simple_lock, |
| 304 | + pub f_vinfo: crate::caddr_t, |
| 305 | + pub f_ops: *mut fileops_t, |
| 306 | + pub f_parentp: crate::caddr_t, |
| 307 | + pub f_fnamep: crate::caddr_t, |
| 308 | + pub f_fdata: [c_char; 160], |
| 309 | + } |
| 310 | + |
| 311 | + pub union __ld_info_file { |
| 312 | + pub _ldinfo_fd: c_int, |
| 313 | + pub _ldinfo_fp: *mut file, |
| 314 | + pub _core_offset: c_long, |
| 315 | + } |
| 316 | + |
| 317 | + pub struct ld_info { |
| 318 | + pub ldinfo_next: c_uint, |
| 319 | + pub ldinfo_flags: c_uint, |
| 320 | + pub _file: __ld_info_file, |
| 321 | + pub ldinfo_textorg: *mut c_void, |
| 322 | + pub ldinfo_textsize: c_ulong, |
| 323 | + pub ldinfo_dataorg: *mut c_void, |
| 324 | + pub ldinfo_datasize: c_ulong, |
| 325 | + pub ldinfo_filename: [c_char; 2], |
| 326 | + } |
| 327 | + |
259 | 328 | pub union __pollfd_ext_u { |
260 | 329 | pub addr: *mut c_void, |
261 | 330 | pub data32: u32, |
@@ -327,6 +396,73 @@ cfg_if! { |
327 | 396 | self.__si_flags.hash(state); |
328 | 397 | } |
329 | 398 | } |
| 399 | + |
| 400 | + impl Eq for _kernel_simple_lock {} |
| 401 | + impl hash::Hash for _kernel_simple_lock { |
| 402 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 403 | + unsafe { |
| 404 | + self._slock.hash(state); |
| 405 | + self._slockp.hash(state); |
| 406 | + } |
| 407 | + } |
| 408 | + } |
| 409 | + |
| 410 | + impl Eq for fileops_t {} |
| 411 | + impl hash::Hash for fileops_t { |
| 412 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 413 | + self.fo_rw.hash(state); |
| 414 | + self.fo_ioctl.hash(state); |
| 415 | + self.fo_select.hash(state); |
| 416 | + self.fo_close.hash(state); |
| 417 | + self.fo_fstat.hash(state); |
| 418 | + } |
| 419 | + } |
| 420 | + |
| 421 | + impl Eq for file {} |
| 422 | + impl hash::Hash for file { |
| 423 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 424 | + self.f_flag.hash(state); |
| 425 | + self.f_count.hash(state); |
| 426 | + self.f_options.hash(state); |
| 427 | + self.f_type.hash(state); |
| 428 | + self.f_data.hash(state); |
| 429 | + self.f_offset.hash(state); |
| 430 | + self.f_dir_off.hash(state); |
| 431 | + self.f_cred.hash(state); |
| 432 | + self.f_lock.hash(state); |
| 433 | + self.f_offset_lock.hash(state); |
| 434 | + self.f_vinfo.hash(state); |
| 435 | + self.f_ops.hash(state); |
| 436 | + self.f_parentp.hash(state); |
| 437 | + self.f_fnamep.hash(state); |
| 438 | + self.f_fdata.hash(state); |
| 439 | + } |
| 440 | + } |
| 441 | + |
| 442 | + impl Eq for __ld_info_file {} |
| 443 | + impl hash::Hash for __ld_info_file { |
| 444 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 445 | + unsafe { |
| 446 | + self._ldinfo_fd.hash(state); |
| 447 | + self._ldinfo_fp.hash(state); |
| 448 | + self._core_offset.hash(state); |
| 449 | + } |
| 450 | + } |
| 451 | + } |
| 452 | + |
| 453 | + impl Eq for ld_info {} |
| 454 | + impl hash::Hash for ld_info { |
| 455 | + fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 456 | + self.ldinfo_next.hash(state); |
| 457 | + self.ldinfo_flags.hash(state); |
| 458 | + self.ldinfo_textorg.hash(state); |
| 459 | + self.ldinfo_textsize.hash(state); |
| 460 | + self.ldinfo_dataorg.hash(state); |
| 461 | + self.ldinfo_datasize.hash(state); |
| 462 | + self.ldinfo_filename.hash(state); |
| 463 | + self._file.hash(state); |
| 464 | + } |
| 465 | + } |
330 | 466 | impl PartialEq for __pollfd_ext_u { |
331 | 467 | fn eq(&self, other: &__pollfd_ext_u) -> bool { |
332 | 468 | unsafe { |
|
0 commit comments