1919use crate::fscrypt_key_specifier;
2020use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
2121
22+ // SAFETY: The IntoBytes implementation is safe because the array size is a
23+ // multiple of 8, so there is no padding.
24+ unsafe impl IntoBytes for __BindgenOpaqueArray8<[u8; 8usize]> {
25+ fn only_derive_is_allowed_to_implement_this_trait() {}
26+ }
27+
28+ // SAFETY: The IntoBytes implementation is safe because the array size is a
29+ // multiple of 8, so there is no padding.
30+ unsafe impl IntoBytes for __BindgenOpaqueArray8<[u8; 16usize]> {
31+ fn only_derive_is_allowed_to_implement_this_trait() {}
32+ }
33+
34+ // SAFETY: The IntoBytes implementation is safe because the array size is a
35+ // multiple of 8, so there is no padding.
36+ unsafe impl IntoBytes for __BindgenOpaqueArray8<[u8; 144usize]> {
37+ fn only_derive_is_allowed_to_implement_this_trait() {}
38+ }
39+
40+ // SAFETY: The IntoBytes implementation is safe because the array size is a
41+ // multiple of 8, so there is no padding.
42+ unsafe impl IntoBytes for __BindgenOpaqueArray8<[u8; 272usize]> {
43+ fn only_derive_is_allowed_to_implement_this_trait() {}
44+ }
45+
2246#[repr(C)]
2347#[derive(
2448 Copy,
@@ -147,6 +171,24 @@ where
147171 }
148172 }
149173}
174+ #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
175+ #[repr(C)]
176+ #[derive(FromBytes, Immutable, IntoBytes, KnownLayout)]
177+ pub struct __BindgenOpaqueArray<T>(pub T);
178+ impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<[T; N]> {
179+ fn default() -> Self {
180+ Self([<T as Default>::default(); N])
181+ }
182+ }
183+ #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
184+ #[repr(C, align(8))]
185+ #[derive(FromBytes, Immutable, KnownLayout)]
186+ pub struct __BindgenOpaqueArray8<T>(pub T);
187+ impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray8<[T; N]> {
188+ fn default() -> Self {
189+ Self([<T as Default>::default(); N])
190+ }
191+ }
150192#[repr(transparent)]
151193#[derive(Default, Clone, FromBytes, Immutable, IntoBytes, KnownLayout)]
152194pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
@@ -10547,7 +10589,7 @@ pub struct io_uring_sqe__bindgen_ty_6 {
1054710589 pub __bindgen_anon_1: __BindgenUnionField<io_uring_sqe__bindgen_ty_6__bindgen_ty_1>,
1054810590 pub optval: __BindgenUnionField<__u64>,
1054910591 pub cmd: __BindgenUnionField<[__u8; 0usize]>,
10550- pub bindgen_union_field: [u64; 2usize] ,
10592+ pub bindgen_union_field: __BindgenOpaqueArray8<[u8; 16usize]> ,
1055110593}
1055210594#[repr(C)]
1055310595#[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
@@ -10844,7 +10886,7 @@ pub struct io_uring_buf_ring {
1084410886pub struct io_uring_buf_ring__bindgen_ty_1 {
1084510887 pub __bindgen_anon_1: __BindgenUnionField<io_uring_buf_ring__bindgen_ty_1__bindgen_ty_1>,
1084610888 pub __bindgen_anon_2: __BindgenUnionField<io_uring_buf_ring__bindgen_ty_1__bindgen_ty_2>,
10847- pub bindgen_union_field: [u64; 2usize] ,
10889+ pub bindgen_union_field: __BindgenOpaqueArray8<[u8; 16usize]> ,
1084810890}
1084910891#[repr(C)]
1085010892#[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
@@ -11770,41 +11812,27 @@ impl Default for group_source_req {
1177011812}
1177111813#[repr(C)]
1177211814#[repr(align(4))]
11815+ #[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
1177311816pub struct group_filter {
11774- pub _bindgen_opaque_blob: [u32; 67usize],
11817+ pub _bindgen_opaque_blob: __BindgenOpaqueArray< [u32; 67usize]> ,
1177511818}
1177611819#[repr(C)]
1177711820#[repr(align(4))]
11778- pub struct group_filter__bindgen_ty_1 {
11779- pub _bindgen_opaque_blob: [u32; 67usize],
11821+ #[derive(Copy, Clone)]
11822+ pub union group_filter__bindgen_ty_1 {
11823+ pub _bindgen_opaque_blob: __BindgenOpaqueArray<[u32; 67usize]>,
1178011824}
1178111825#[repr(C)]
1178211826#[repr(align(4))]
11827+ #[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
1178311828pub struct group_filter__bindgen_ty_1__bindgen_ty_1 {
11784- pub _bindgen_opaque_blob: [u32; 67usize],
11785- }
11786- impl Default for group_filter__bindgen_ty_1__bindgen_ty_1 {
11787- fn default() -> Self {
11788- let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11789- unsafe {
11790- ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11791- s.assume_init()
11792- }
11793- }
11829+ pub _bindgen_opaque_blob: __BindgenOpaqueArray<[u32; 67usize]>,
1179411830}
1179511831#[repr(C)]
1179611832#[repr(align(4))]
11833+ #[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
1179711834pub struct group_filter__bindgen_ty_1__bindgen_ty_2 {
11798- pub _bindgen_opaque_blob: [u32; 35usize],
11799- }
11800- impl Default for group_filter__bindgen_ty_1__bindgen_ty_2 {
11801- fn default() -> Self {
11802- let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11803- unsafe {
11804- ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11805- s.assume_init()
11806- }
11807- }
11835+ pub _bindgen_opaque_blob: __BindgenOpaqueArray<[u32; 35usize]>,
1180811836}
1180911837impl Default for group_filter__bindgen_ty_1 {
1181011838 fn default() -> Self {
@@ -11815,15 +11843,6 @@ impl Default for group_filter__bindgen_ty_1 {
1181511843 }
1181611844 }
1181711845}
11818- impl Default for group_filter {
11819- fn default() -> Self {
11820- let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11821- unsafe {
11822- ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11823- s.assume_init()
11824- }
11825- }
11826- }
1182711846#[repr(C)]
1182811847#[derive(Debug, Default, Copy, Clone, IntoBytes, FromBytes, KnownLayout, Immutable)]
1182911848pub struct in_pktinfo {
@@ -19445,7 +19464,7 @@ pub struct fastrpc_ioctl_capability {
1944519464#[repr(align(8))]
1944619465#[derive(Debug, Default)]
1944719466pub struct StdAtomicI64 {
19448- pub _bindgen_opaque_blob: u64 ,
19467+ pub _bindgen_opaque_blob: __BindgenOpaqueArray8<[u8; 8usize]> ,
1944919468}
1945019469#[repr(C)]
1945119470#[repr(align(4))]
@@ -19457,7 +19476,7 @@ pub struct StdAtomicU32 {
1945719476#[repr(align(8))]
1945819477#[derive(Debug, Default)]
1945919478pub struct StdAtomicU64 {
19460- pub _bindgen_opaque_blob: u64 ,
19479+ pub _bindgen_opaque_blob: __BindgenOpaqueArray8<[u8; 8usize]> ,
1946119480}
1946219481#[repr(C)]
1946319482#[derive(Debug, Default)]
0 commit comments