From 967babd1e64b089198fa289579129e574f39a00a Mon Sep 17 00:00:00 2001 From: Knight Date: Mon, 25 Jul 2016 20:22:43 +0800 Subject: [PATCH] pinky: implement short format --- src/uucore/utmpx.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/uucore/utmpx.rs b/src/uucore/utmpx.rs index 58bedc91a..037c1d514 100644 --- a/src/uucore/utmpx.rs +++ b/src/uucore/utmpx.rs @@ -2,7 +2,7 @@ extern crate libc; -pub use self::utmpx::{DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp}; +pub use self::utmpx::{UT_NAMESIZE,UT_LINESIZE,DEFAULT_FILE,USER_PROCESS,BOOT_TIME,c_utmp}; #[cfg(target_os = "linux")] mod utmpx { use super::libc; @@ -25,6 +25,12 @@ mod utmpx { pub const DEAD_PROCESS: libc::c_short = 8; pub const ACCOUNTING: libc::c_short = 9; + #[repr(C)] + pub struct timeval { + pub tv_sec: libc::int32_t, + pub tv_usec: libc::int32_t, + } + #[repr(C)] pub struct c_exit_status { pub e_termination: libc::c_short, @@ -41,8 +47,8 @@ mod utmpx { pub ut_user: [libc::c_char; UT_NAMESIZE], pub ut_host: [libc::c_char; UT_HOSTSIZE], pub ut_exit: c_exit_status, - pub ut_session: libc::c_long, - pub ut_tv: libc::timeval, + pub ut_session: libc::int32_t, + pub ut_tv: timeval, pub ut_addr_v6: [libc::int32_t; 4], pub __unused: [libc::c_char; 20],