@@ -299,6 +299,19 @@ s! {
299
299
pub shm_ctime: :: time_t,
300
300
_shm_internal: * mut :: c_void,
301
301
}
302
+
303
+ pub struct utmp {
304
+ pub ut_line: [ :: c_char; UT_LINESIZE ] ,
305
+ pub ut_name: [ :: c_char; UT_NAMESIZE ] ,
306
+ pub ut_host: [ :: c_char; UT_HOSTSIZE ] ,
307
+ pub ut_time: :: time_t
308
+ }
309
+
310
+ pub struct lastlog {
311
+ pub ll_line: [ :: c_char; UT_LINESIZE ] ,
312
+ pub ll_host: [ :: c_char; UT_HOSTSIZE ] ,
313
+ pub ll_time: :: time_t
314
+ }
302
315
}
303
316
304
317
s_no_extra_traits ! {
@@ -1517,6 +1530,9 @@ pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS;
1517
1530
// pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx";
1518
1531
// pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx";
1519
1532
// pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update";
1533
+ pub const UT_NAMESIZE : usize = 8 ;
1534
+ pub const UT_LINESIZE : usize = 8 ;
1535
+ pub const UT_HOSTSIZE : usize = 16 ;
1520
1536
pub const _UTX_USERSIZE: usize = 32 ;
1521
1537
pub const _UTX_LINESIZE: usize = 32 ;
1522
1538
pub const _UTX_PADSIZE: usize = 40 ;
@@ -1914,9 +1930,14 @@ extern "C" {
1914
1930
pub fn pututxline ( ut : * const utmpx ) -> * mut utmpx ;
1915
1931
pub fn setutxent ( ) ;
1916
1932
pub fn endutxent ( ) ;
1917
- // TODO: uncomment after utmp implementation
1918
- // pub fn getutmp(ux: *const utmpx, u: *mut utmp);
1919
- // pub fn getutmpx(u: *const utmp, ux: *mut utmpx);
1933
+
1934
+ pub fn getutmp ( ux : * const utmpx , u : * mut utmp ) ;
1935
+ pub fn getutmpx ( u : * const utmp , ux : * mut utmpx ) ;
1936
+
1937
+ pub fn utpname ( file : * const :: c_char ) -> :: c_int ;
1938
+ pub fn setutent ( ) ;
1939
+ pub fn endutent ( ) ;
1940
+ pub fn getutent ( ) -> * mut utmp ;
1920
1941
}
1921
1942
1922
1943
cfg_if ! {
0 commit comments