/* automatically generated by rust-bindgen 0.68.1 */ pub const __BITS_PER_LONG_LONG: u32 = 64; pub const USERFAULTFD_IOC: u32 = 170; 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_MOVE: u64 = 5; pub const _UFFDIO_WRITEPROTECT: u64 = 6; pub const _UFFDIO_CONTINUE: u64 = 7; pub const _UFFDIO_POISON: u64 = 8; 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_FEATURE_WP_UNPOPULATED: u64 = 8192; pub const UFFD_FEATURE_POISON: u64 = 16384; pub const UFFD_FEATURE_WP_ASYNC: u64 = 32768; pub const UFFD_FEATURE_MOVE: u64 = 65536; 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() { const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__kernel_fd_set), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(__kernel_fsid_t), "::", stringify!(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 __s128 = i128; pub type __u128 = u128; 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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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] fn bindgen_test_layout_uffd_msg__bindgen_ty_1__bindgen_ty_1() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); } #[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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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) ) ); } #[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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); } #[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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); } #[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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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) ) ); assert_eq!( unsafe { ::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] fn bindgen_test_layout_uffd_msg__bindgen_ty_1() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pagefault) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(pagefault) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fork) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(fork) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).remap) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(remap) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).remove) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg__bindgen_ty_1), "::", stringify!(remove) ) ); assert_eq!( unsafe { ::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] fn bindgen_test_layout_uffd_msg() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).event) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(event) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved1) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved2) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(reserved3) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).arg) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffd_msg), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).api) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(api) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(features) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_api), "::", stringify!(ioctls) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_range { pub start: __u64, pub len: __u64, } #[test] fn bindgen_test_layout_uffdio_range() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_range), "::", stringify!(start) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_range), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ioctls) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_register), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(dst) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(src) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(len) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(uffdio_copy), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).zeropage) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_zeropage), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_writeprotect), "::", stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_writeprotect), "::", stringify!(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() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); 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)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mapped) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_continue), "::", stringify!(mapped) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_poison { pub range: uffdio_range, pub mode: __u64, pub updated: __s64, } #[test] fn bindgen_test_layout_uffdio_poison() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(uffdio_poison)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_poison)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).range) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_poison), "::", stringify!(range) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_poison), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).updated) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_poison), "::", stringify!(updated) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct uffdio_move { pub dst: __u64, pub src: __u64, pub len: __u64, pub mode: __u64, pub move_: __s64, } #[test] fn bindgen_test_layout_uffdio_move() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, concat!("Size of: ", stringify!(uffdio_move)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(uffdio_move)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dst) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", stringify!(uffdio_move), "::", stringify!(dst) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(uffdio_move), "::", stringify!(src) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(uffdio_move), "::", stringify!(len) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(uffdio_move), "::", stringify!(mode) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).move_) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(uffdio_move), "::", stringify!(move_) ) ); }