@@ -93,6 +93,23 @@ s_no_extra_traits! {
9393 #[ cfg( libc_union) ]
9494 pub a_un: __c_anonymous_elf64_auxv_union,
9595 }
96+
97+ pub struct kinfo_file {
98+ pub kf_structsize: :: c_int,
99+ pub kf_type: :: c_int,
100+ pub kf_fd: :: c_int,
101+ pub kf_ref_count: :: c_int,
102+ pub kf_flags: :: c_int,
103+ _kf_pad0: :: c_int,
104+ pub kf_offset: i64 ,
105+ _priv: [ :: uintptr_t; 38 ] , // FIXME if needed
106+ pub kf_status: u16 ,
107+ _kf_pad1: u16 ,
108+ _kf_ispare0: :: c_int,
109+ pub kf_cap_rights: :: cap_rights_t,
110+ _kf_cap_spare: u64 ,
111+ pub kf_path: [ :: c_char; :: PATH_MAX as usize ] ,
112+ }
96113}
97114
98115cfg_if ! {
@@ -236,6 +253,52 @@ cfg_if! {
236253 . finish( )
237254 }
238255 }
256+
257+ impl PartialEq for kinfo_file {
258+ fn eq( & self , other: & kinfo_file) -> bool {
259+ self . kf_structsize == other. kf_structsize &&
260+ self . kf_type == other. kf_type &&
261+ self . kf_fd == other. kf_fd &&
262+ self . kf_ref_count == other. kf_ref_count &&
263+ self . kf_flags == other. kf_flags &&
264+ self . kf_offset == other. kf_offset &&
265+ self . kf_status == other. kf_status &&
266+ self . kf_cap_rights == other. kf_cap_rights &&
267+ self . kf_path
268+ . iter( )
269+ . zip( other. kf_path. iter( ) )
270+ . all( |( a, b) | a == b)
271+ }
272+ }
273+ impl Eq for kinfo_file { }
274+ impl :: fmt:: Debug for kinfo_file {
275+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
276+ f. debug_struct( "kinfo_file" )
277+ . field( "kf_structsize" , & self . kf_structsize)
278+ . field( "kf_type" , & self . kf_type)
279+ . field( "kf_fd" , & self . kf_fd)
280+ . field( "kf_ref_count" , & self . kf_ref_count)
281+ . field( "kf_flags" , & self . kf_flags)
282+ . field( "kf_offset" , & self . kf_offset)
283+ . field( "kf_status" , & self . kf_status)
284+ . field( "kf_cap_rights" , & self . kf_cap_rights)
285+ . field( "kf_path" , &&self . kf_path[ ..] )
286+ . finish( )
287+ }
288+ }
289+ impl :: hash:: Hash for kinfo_file {
290+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
291+ self . kf_structsize. hash( state) ;
292+ self . kf_type. hash( state) ;
293+ self . kf_fd. hash( state) ;
294+ self . kf_ref_count. hash( state) ;
295+ self . kf_flags. hash( state) ;
296+ self . kf_offset. hash( state) ;
297+ self . kf_status. hash( state) ;
298+ self . kf_cap_rights. hash( state) ;
299+ self . kf_path. hash( state) ;
300+ }
301+ }
239302 }
240303}
241304
0 commit comments