@@ -364,10 +364,63 @@ s_no_extra_traits! {
364
364
__unused1: * mut :: c_void, // actually a function pointer
365
365
pub sigev_notify_attributes: * mut :: pthread_attr_t,
366
366
}
367
+
368
+ pub struct utmpx {
369
+ pub ut_type: :: c_short,
370
+ pub ut_tv: :: timeval,
371
+ pub ut_id: [ :: c_char; 8 ] ,
372
+ pub ut_pid: :: pid_t,
373
+ pub ut_user: [ :: c_char; 32 ] ,
374
+ pub ut_line: [ :: c_char; 16 ] ,
375
+ pub ut_host: [ :: c_char; 128 ] ,
376
+ __ut_reserved: [ :: c_char; 64 ] ,
377
+ }
367
378
}
368
379
369
380
cfg_if ! {
370
381
if #[ cfg( feature = "extra_traits" ) ] {
382
+ impl PartialEq for utmpx {
383
+ fn eq( & self , other: & utmpx) -> bool {
384
+ self . ut_type == other. ut_type
385
+ && self . ut_tv == other. ut_tv
386
+ && self . ut_id == other. ut_id
387
+ && self . ut_pid == other. ut_pid
388
+ && self . ut_user == other. ut_user
389
+ && self . ut_line == other. ut_line
390
+ && self . ut_host. iter( ) . zip( other. ut_host. iter( ) ) . all( |( a, b) | a == b)
391
+ && self . __ut_reserved == other. __ut_reserved
392
+ }
393
+ }
394
+
395
+ impl Eq for utmpx { }
396
+
397
+ impl :: fmt:: Debug for utmpx {
398
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
399
+ f. debug_struct( "utmpx" )
400
+ . field( "ut_type" , & self . ut_type)
401
+ . field( "ut_tv" , & self . ut_tv)
402
+ . field( "ut_id" , & self . ut_id)
403
+ . field( "ut_pid" , & self . ut_pid)
404
+ . field( "ut_user" , & self . ut_user)
405
+ . field( "ut_line" , & self . ut_line)
406
+ . field( "ut_host" , & self . ut_host)
407
+ . field( "__ut_reserved" , & self . __ut_reserved)
408
+ . finish( )
409
+ }
410
+ }
411
+
412
+ impl :: hash:: Hash for utmpx {
413
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
414
+ self . ut_type. hash( state) ;
415
+ self . ut_tv. hash( state) ;
416
+ self . ut_id. hash( state) ;
417
+ self . ut_pid. hash( state) ;
418
+ self . ut_user. hash( state) ;
419
+ self . ut_line. hash( state) ;
420
+ self . ut_host. hash( state) ;
421
+ self . __ut_reserved. hash( state) ;
422
+ }
423
+ }
371
424
impl PartialEq for sockaddr_un {
372
425
fn eq( & self , other: & sockaddr_un) -> bool {
373
426
self . sun_len == other. sun_len
0 commit comments