@@ -1143,15 +1143,6 @@ s! {
11431143 pub nativeattr: attribute_set_t,
11441144 }
11451145
1146- #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
1147- pub struct ifconf {
1148- pub ifc_len: :: c_int,
1149- #[ cfg( libc_union) ]
1150- pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1151- #[ cfg( not( libc_union) ) ]
1152- pub ifc_ifcu: * mut ifreq,
1153- }
1154-
11551146 #[ cfg_attr( libc_align, repr( align( 8 ) ) ) ]
11561147 pub struct tcp_connection_info {
11571148 pub tcpi_state: u8 ,
@@ -1202,6 +1193,15 @@ s! {
12021193}
12031194
12041195s_no_extra_traits ! {
1196+ #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
1197+ pub struct ifconf {
1198+ pub ifc_len: :: c_int,
1199+ #[ cfg( libc_union) ]
1200+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1201+ #[ cfg( not( libc_union) ) ]
1202+ pub ifc_ifcu: * mut ifreq,
1203+ }
1204+
12051205 #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
12061206 pub struct kevent {
12071207 pub ident: :: uintptr_t,
@@ -1617,6 +1617,32 @@ cfg_if! {
16171617
16181618cfg_if ! {
16191619 if #[ cfg( feature = "extra_traits" ) ] {
1620+ impl PartialEq for ifconf
1621+ where
1622+ Self : Copy
1623+ {
1624+ fn eq( & self , other: & Self ) -> bool {
1625+ let len_ptr1 = core:: ptr:: addr_of!( self . ifc_len) ;
1626+ let len_ptr2 = core:: ptr:: addr_of!( other. ifc_len) ;
1627+ let ifcu_ptr1 = core:: ptr:: addr_of!( self . ifc_ifcu) ;
1628+ let ifcu_ptr2 = core:: ptr:: addr_of!( other. ifc_ifcu) ;
1629+
1630+ // SAFETY: `ifconf` implements `Copy` so the reads are valid
1631+ let len1 = unsafe { len_ptr1. read_unaligned( ) } ;
1632+ let len2 = unsafe { len_ptr2. read_unaligned( ) } ;
1633+ let ifcu1 = unsafe { ifcu_ptr1. read_unaligned( ) } ;
1634+ let ifcu2 = unsafe { ifcu_ptr2. read_unaligned( ) } ;
1635+
1636+ len1 == len2 && ifcu1 == ifcu2
1637+ }
1638+ }
1639+ impl Eq for ifconf { }
1640+ impl :: fmt:: Debug for ifconf {
1641+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1642+ f. debug_struct( "ifconf" ) . finish_non_exhaustive( )
1643+ }
1644+ }
1645+
16201646 impl PartialEq for kevent {
16211647 fn eq( & self , other: & kevent) -> bool {
16221648 self . ident == other. ident
@@ -1627,6 +1653,7 @@ cfg_if! {
16271653 && self . udata == other. udata
16281654 }
16291655 }
1656+
16301657 impl Eq for kevent { }
16311658 impl :: fmt:: Debug for kevent {
16321659 fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
0 commit comments