@@ -230,6 +230,13 @@ s_no_extra_traits! {
230
230
pub ut_unused2: [ u8 ; 16 ] ,
231
231
}
232
232
233
+ pub struct lastlogx {
234
+ pub ll_tv: :: timeval,
235
+ pub ll_line: [ :: c_char; _UTX_LINESIZE] ,
236
+ pub ll_host: [ :: c_char; _UTX_HOSTSIZE] ,
237
+ pub ll_ss: :: sockaddr_storage,
238
+ }
239
+
233
240
pub struct dirent {
234
241
pub d_fileno: :: ino_t,
235
242
pub d_namlen: u16 ,
@@ -376,6 +383,33 @@ cfg_if! {
376
383
self . ut_unused2. hash( state) ;
377
384
}
378
385
}
386
+ impl PartialEq for lastlogx {
387
+ fn eq( & self , other: & lastlogx) -> bool {
388
+ self . ll_tv == other. ll_tv
389
+ && self . ll_line == other. ll_line
390
+ && self . ll_host == other. ll_host
391
+ && self . ll_ss == other. ll_ss
392
+ }
393
+ }
394
+ impl Eq for lastlogx { }
395
+ impl :: fmt:: Debug for lastlogx {
396
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
397
+ f. debug_struct( "lastlogx" )
398
+ . field( "ll_tv" , & self . ll_tv)
399
+ . field( "ll_line" , & self . ll_line)
400
+ . field( "ll_host" , & self . ll_host)
401
+ . field( "ll_ss" , & self . ll_ss)
402
+ . finish( )
403
+ }
404
+ }
405
+ impl :: hash:: Hash for lastlogx {
406
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
407
+ self . ll_tv. hash( state) ;
408
+ self . ll_line. hash( state) ;
409
+ self . ll_host. hash( state) ;
410
+ self . ll_ss. hash( state) ;
411
+ }
412
+ }
379
413
380
414
impl PartialEq for dirent {
381
415
fn eq( & self , other: & dirent) -> bool {
@@ -1120,6 +1154,10 @@ pub const DOWNTIME: ::c_short = 11;
1120
1154
pub const UTX_DB_UTMPX : :: c_uint = 0 ;
1121
1155
pub const UTX_DB_WTMPX : :: c_uint = 1 ;
1122
1156
pub const UTX_DB_LASTLOG : :: c_uint = 2 ;
1157
+ pub const _UTX_LINESIZE: usize = 32 ;
1158
+ pub const _UTX_USERSIZE: usize = 32 ;
1159
+ pub const _UTX_IDSIZE: usize = 4 ;
1160
+ pub const _UTX_HOSTSIZE: usize = 256 ;
1123
1161
1124
1162
pub const LC_COLLATE_MASK : :: c_int = 1 << 0 ;
1125
1163
pub const LC_CTYPE_MASK : :: c_int = 1 << 1 ;
@@ -1308,6 +1346,12 @@ extern "C" {
1308
1346
pub fn shmdt ( shmaddr : * const :: c_void ) -> :: c_int ;
1309
1347
pub fn shmctl ( shmid : :: c_int , cmd : :: c_int , buf : * mut :: shmid_ds ) -> :: c_int ;
1310
1348
pub fn procctl ( idtype : :: idtype_t , id : :: id_t , cmd : :: c_int , data : * mut :: c_void ) -> :: c_int ;
1349
+
1350
+ pub fn updwtmpx ( file : * const :: c_char , ut : * const utmpx ) -> :: c_int ;
1351
+ pub fn getlastlogx ( fname : * const :: c_char , uid : :: uid_t , ll : * mut lastlogx ) -> * mut lastlogx ;
1352
+ pub fn updlastlogx ( fname : * const :: c_char , uid : :: uid_t , ll : * mut lastlogx ) -> :: c_int ;
1353
+ pub fn getutxuser ( name : * const :: c_char ) -> utmpx ;
1354
+ pub fn utmpxname ( file : * const :: c_char ) -> :: c_int ;
1311
1355
}
1312
1356
1313
1357
#[ link( name = "rt" ) ]
0 commit comments