/* automatically generated by rust-bindgen 0.60.1 */ pub const _UFFDIO_REGISTER: u64 = 0; pub const _UFFDIO_UNREGISTER: u64 = 1; pub const _UFFDIO_WAKE: u64 = 2; pub const _UFFDIO_COPY: u64 = 3; pub const _UFFDIO_ZEROPAGE: u64 = 4; pub const _UFFDIO_WRITEPROTECT: u64 = 6; pub const _UFFDIO_CONTINUE: u64 = 7; pub const _UFFDIO_API: u64 = 63; pub const UFFDIO: u8 = 170; pub const UFFD_EVENT_PAGEFAULT: u8 = 18; pub const UFFD_EVENT_FORK: u8 = 19; pub const UFFD_EVENT_REMAP: u8 = 20; pub const UFFD_EVENT_REMOVE: u8 = 21; pub const UFFD_EVENT_UNMAP: u8 = 22; pub const UFFD_PAGEFAULT_FLAG_WRITE: u64 = 1; pub const UFFD_PAGEFAULT_FLAG_WP: u64 = 2; pub const UFFD_PAGEFAULT_FLAG_MINOR: u64 = 4; pub const UFFD_FEATURE_PAGEFAULT_FLAG_WP: u64 = 1; pub const UFFD_FEATURE_EVENT_FORK: u64 = 2; pub const UFFD_FEATURE_EVENT_REMAP: u64 = 4; pub const UFFD_FEATURE_EVENT_REMOVE: u64 = 8; pub const UFFD_FEATURE_MISSING_HUGETLBFS: u64 = 16; pub const UFFD_FEATURE_MISSING_SHMEM: u64 = 32; pub const UFFD_FEATURE_EVENT_UNMAP: u64 = 64; pub const UFFD_FEATURE_SIGBUS: u64 = 128; pub const UFFD_FEATURE_THREAD_ID: u64 = 256; pub const UFFD_FEATURE_MINOR_HUGETLBFS: u64 = 512; pub const UFFD_FEATURE_MINOR_SHMEM: u64 = 1024; pub const UFFD_FEATURE_EXACT_ADDRESS: u64 = 2048; pub const UFFD_FEATURE_WP_HUGETLBFS_SHMEM: u64 = 4096; pub const UFFD_USER_MODE_ONLY: u32 = 1; pub type __s8 = ::std::os::raw::c_schar; pub type __u8 = ::std::os::raw::c_uchar; pub type __s16 = ::std::os::raw::c_short; pub type __u16 = ::std::os::raw::c_ushort; pub type __s32 = ::std::os::raw::c_int; pub type __u32 = ::std::os::raw::c_uint; pub type __s64 = ::std::os::raw::c_longlong; pub type __u64 = ::std::os::raw::c_ulonglong; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 16usize], } #[test] fn bindgen_test_layout___kernel_fd_set() { assert_eq!( ::std::mem::size_of::<__kernel_fd_set>(), 128usize, concat!("Size of: ", stringify!(__kernel_fd_set)) ); assert_eq!( ::std::mem::align_of::<__kernel_fd_set>(), 8usize, concat!("Alignment of ", stringify!(__kernel_fd_set)) ); fn test_field_fds_bits() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::<__kernel_fd_set>::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__kernel_fd_set), "::", stringify!(fds_bits) ) ); } test_field_fds_bits(); } pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; pub type __kernel_mqd_t = ::std::os::raw::c_int; pub type __kernel_old_uid_t = ::std::os::raw::c_ushort; pub type __kernel_old_gid_t = ::std::os::raw::c_ushort; pub type __kernel_old_dev_t = ::std::os::raw::c_ulong; pub type __kernel_long_t = ::std::os::raw::c_long; pub type __kernel_ulong_t = ::std::os::raw::c_ulong; pub type __kernel_ino_t = __kernel_ulong_t; pub type __kernel_mode_t = ::std::os::raw::c_uint; pub type __kernel_pid_t = ::std::os::raw::c_int; pub type __kernel_ipc_pid_t = ::std::os::raw::c_int; pub type __kernel_uid_t = ::std::os::raw::c_uint; pub type __kernel_gid_t = ::std::os::raw::c_uint; pub type __kernel_suseconds_t = __kernel_long_t; pub type __kernel_daddr_t = ::std::os::raw::c_int; pub type __kernel_uid32_t = ::std::os::raw::c_uint; pub type __kernel_gid32_t = ::std::os::raw::c_uint; pub type __kernel_size_t = __kernel_ulong_t; pub type __kernel_ssize_t = __kernel_long_t; pub type __kernel_ptrdiff_t = __kernel_long_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } #[test] fn bindgen_test_layout___kernel_fsid_t() { assert_eq!( ::std::mem::size_of::<__kernel_fsid_t>(), 8usize, concat!("Size of: ", stringify!(__kernel_fsid_t)) ); assert_eq!( ::std::mem::align_of::<__kernel_fsid_t>(), 4usize, concat!("Alignment of ", stringify!(__kernel_fsid_t)) ); fn test_field_val() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::<__kernel_fsid_t>::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__kernel_fsid_t), "::", stringify!(val) ) ); } test_field_val(); } pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; pub type __kernel_time_t = __kernel_long_t; pub type __kernel_time64_t = ::std::os::raw::c_longlong; pub type __kernel_clock_t = __kernel_long_t; pub type __kernel_timer_t = ::std::os::raw::c_int; pub type __kernel_clockid_t = ::std::os::raw::c_int; pub type __kernel_caddr_t = *mut ::std::os::raw::c_char; pub type __kernel_uid16_t = ::std::os::raw::c_ushort; pub type __kernel_gid16_t = ::std::os::raw::c_ushort; pub type __poll_t = ::std::os::raw::c_uint; #[repr(C, packed)] #[derive(Copy, Clone)] pub struct uffd_msg { pub event: __u8, pub reserved1: __u8, pub reserved2: __u16, pub reserved3: __u32, pub arg: uffd_msg__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union uffd_msg__bindgen_ty_1 { pub pagefault: uffd_msg__bindgen_ty_1__bindgen_ty_1, pub fork: uffd_msg__bindgen_ty_1__bindgen_ty_2, pub remap: uffd_msg__bindgen_ty_1__bindgen_ty_3, pub remove: uffd_msg__bindgen_ty_1__bindgen_ty_4, pub reserved: uffd_msg__bindgen_ty_1__bindgen_ty_5, } #[repr(C)] #[derive(Copy, Clone)] pub struct uffd_msg__bindgen_ty_1__bindgen_ty_1 { pub flags: __u64, pub address: __u64, pub feat: uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { pub ptid: __u32, } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1) ) ); fn test_field_ptid() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::< uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, >::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).ptid) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1), "::", stringify!(ptid) ) ); } test_field_ptid(); } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1) ) ); fn test_field_flags() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1), "::", stringify!(flags) ) ); } test_field_flags(); fn test_field_address() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).address) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1), "::", stringify!(address) ) ); } test_field_address(); fn test_field_feat() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).feat) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_1), "::", stringify!(feat) ) ); } test_field_feat(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffd_msg__bindgen_ty_1__bindgen_ty_2 { pub ufd: __u32, } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_2() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2) ) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2) ) ); fn test_field_ufd() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).ufd) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_2), "::", stringify!(ufd) ) ); } test_field_ufd(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffd_msg__bindgen_ty_1__bindgen_ty_3 { pub from: __u64, pub to: __u64, pub len: __u64, } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_3() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3) ) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3) ) ); fn test_field_from() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).from) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3), "::", stringify!(from) ) ); } test_field_from(); fn test_field_to() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).to) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3), "::", stringify!(to) ) ); } test_field_to(); fn test_field_len() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_3), "::", stringify!(len) ) ); } test_field_len(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffd_msg__bindgen_ty_1__bindgen_ty_4 { pub start: __u64, pub end: __u64, } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_4() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4) ) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4) ) ); fn test_field_start() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4), "::", stringify!(start) ) ); } test_field_start(); fn test_field_end() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_4), "::", stringify!(end) ) ); } test_field_end(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffd_msg__bindgen_ty_1__bindgen_ty_5 { pub reserved1: __u64, pub reserved2: __u64, pub reserved3: __u64, } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_5() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!( "Size of: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5) ) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5) ) ); fn test_field_reserved1() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5), "::", stringify!(reserved1) ) ); } test_field_reserved1(); fn test_field_reserved2() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5), "::", stringify!(reserved2) ) ); } test_field_reserved2(); fn test_field_reserved3() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1__bindgen_ty_5), "::", stringify!(reserved3) ) ); } test_field_reserved3(); } #[test] fn bindgen_test_layout_uffd_msg__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(uffd_msg__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffd_msg__bindgen_ty_1)) ); fn test_field_pagefault() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).pagefault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(pagefault) ) ); } test_field_pagefault(); fn test_field_fork() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).fork) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(fork) ) ); } test_field_fork(); fn test_field_remap() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).remap) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(remap) ) ); } test_field_remap(); fn test_field_remove() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).remove) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(remove) ) ); } test_field_remove(); fn test_field_reserved() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(reserved) ) ); } test_field_reserved(); } #[test] fn bindgen_test_layout_uffd_msg() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(uffd_msg)) ); assert_eq!( ::std::mem::align_of::(), 1usize, concat!("Alignment of ", stringify!(uffd_msg)) ); fn test_field_event() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).event) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(event) ) ); } test_field_event(); fn test_field_reserved1() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved1) ) ); } test_field_reserved1(); fn test_field_reserved2() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved2) ) ); } test_field_reserved2(); fn test_field_reserved3() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved3) ) ); } test_field_reserved3(); fn test_field_arg() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(arg) ) ); } test_field_arg(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_api { pub api: __u64, pub features: __u64, pub ioctls: __u64, } #[test] fn bindgen_test_layout_uffdio_api() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(uffdio_api)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_api)) ); fn test_field_api() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).api) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(api) ) ); } test_field_api(); fn test_field_features() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(features) ) ); } test_field_features(); fn test_field_ioctls() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(ioctls) ) ); } test_field_ioctls(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_range { pub start: __u64, pub len: __u64, } #[test] fn bindgen_test_layout_uffdio_range() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(uffdio_range)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_range)) ); fn test_field_start() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_range), "::", stringify!(start) ) ); } test_field_start(); fn test_field_len() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_range), "::", stringify!(len) ) ); } test_field_len(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_register { pub range: uffdio_range, pub mode: __u64, pub ioctls: __u64, } #[test] fn bindgen_test_layout_uffdio_register() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(uffdio_register)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_register)) ); fn test_field_range() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(range) ) ); } test_field_range(); fn test_field_mode() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(mode) ) ); } test_field_mode(); fn test_field_ioctls() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(ioctls) ) ); } test_field_ioctls(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_copy { pub dst: __u64, pub src: __u64, pub len: __u64, pub mode: __u64, pub copy: __s64, } #[test] fn bindgen_test_layout_uffdio_copy() { assert_eq!( ::std::mem::size_of::(), 40usize, concat!("Size of: ", stringify!(uffdio_copy)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_copy)) ); fn test_field_dst() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(dst) ) ); } test_field_dst(); fn test_field_src() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(src) ) ); } test_field_src(); fn test_field_len() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(len) ) ); } test_field_len(); fn test_field_mode() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(mode) ) ); } test_field_mode(); fn test_field_copy() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(copy) ) ); } test_field_copy(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_zeropage { pub range: uffdio_range, pub mode: __u64, pub zeropage: __s64, } #[test] fn bindgen_test_layout_uffdio_zeropage() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(uffdio_zeropage)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_zeropage)) ); fn test_field_range() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(range) ) ); } test_field_range(); fn test_field_mode() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(mode) ) ); } test_field_mode(); fn test_field_zeropage() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).zeropage) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(zeropage) ) ); } test_field_zeropage(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_writeprotect { pub range: uffdio_range, pub mode: __u64, } #[test] fn bindgen_test_layout_uffdio_writeprotect() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(uffdio_writeprotect)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_writeprotect)) ); fn test_field_range() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_writeprotect), "::", stringify!(range) ) ); } test_field_range(); fn test_field_mode() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_writeprotect), "::", stringify!(mode) ) ); } test_field_mode(); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_continue { pub range: uffdio_range, pub mode: __u64, pub mapped: __s64, } #[test] fn bindgen_test_layout_uffdio_continue() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(uffdio_continue)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_continue)) ); fn test_field_range() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(range) ) ); } test_field_range(); fn test_field_mode() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(mode) ) ); } test_field_mode(); fn test_field_mapped() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).mapped) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(mapped) ) ); } test_field_mapped(); }