@@ -4,6 +4,40 @@ pub type rlim_t = c_ulong;
44pub type __priority_which_t = :: c_uint ;
55
66s ! {
7+ pub struct __exit_status {
8+ pub e_termination: :: c_short,
9+ pub e_exit: :: c_short,
10+ }
11+
12+ pub struct __timeval {
13+ pub tv_sec: :: int32_t,
14+ pub tv_usec: :: int32_t,
15+ }
16+
17+ pub struct utmpx {
18+ pub ut_type: :: c_short,
19+ pub ut_pid: :: pid_t,
20+ pub ut_line: [ :: c_char; __UT_LINESIZE] ,
21+ pub ut_id: [ :: c_char; 4 ] ,
22+
23+ pub ut_user: [ :: c_char; __UT_NAMESIZE] ,
24+ pub ut_host: [ :: c_char; __UT_HOSTSIZE] ,
25+ pub ut_exit: __exit_status,
26+
27+ #[ cfg( any( target_arch = "aarch64" , target_pointer_width = "32" ) ) ]
28+ pub ut_session: :: c_long,
29+ #[ cfg( any( target_arch = "aarch64" , target_pointer_width = "32" ) ) ]
30+ pub ut_tv: :: timeval,
31+
32+ #[ cfg( not( any( target_arch = "aarch64" , target_pointer_width = "32" ) ) ) ]
33+ pub ut_session: :: int32_t,
34+ #[ cfg( not( any( target_arch = "aarch64" , target_pointer_width = "32" ) ) ) ]
35+ pub ut_tv: __timeval,
36+
37+ pub ut_addr_v6: [ :: int32_t; 4 ] ,
38+ __glibc_reserved: [ :: c_char; 20 ] ,
39+ }
40+
741 pub struct sigaction {
842 pub sa_sigaction: :: sighandler_t,
943 pub sa_mask: :: sigset_t,
@@ -132,6 +166,20 @@ s! {
132166 }
133167}
134168
169+ pub const __UT_LINESIZE: usize = 32 ;
170+ pub const __UT_NAMESIZE: usize = 32 ;
171+ pub const __UT_HOSTSIZE: usize = 256 ;
172+ pub const EMPTY : :: c_short = 0 ;
173+ pub const RUN_LVL : :: c_short = 1 ;
174+ pub const BOOT_TIME : :: c_short = 2 ;
175+ pub const NEW_TIME : :: c_short = 3 ;
176+ pub const OLD_TIME : :: c_short = 4 ;
177+ pub const INIT_PROCESS : :: c_short = 5 ;
178+ pub const LOGIN_PROCESS : :: c_short = 6 ;
179+ pub const USER_PROCESS : :: c_short = 7 ;
180+ pub const DEAD_PROCESS : :: c_short = 8 ;
181+ pub const ACCOUNTING : :: c_short = 9 ;
182+
135183pub const RLIMIT_RSS : :: c_int = 5 ;
136184pub const RLIMIT_NOFILE : :: c_int = 7 ;
137185pub const RLIMIT_AS : :: c_int = 9 ;
@@ -498,6 +546,16 @@ cfg_if! {
498546 }
499547}
500548
549+ extern {
550+ pub fn utmpxname ( file : * const :: c_char ) -> :: c_int ;
551+ pub fn getutxent ( ) -> * mut utmpx ;
552+ pub fn getutxid ( ut : * const utmpx ) -> * mut utmpx ;
553+ pub fn getutxline ( ut : * const utmpx ) -> * mut utmpx ;
554+ pub fn pututxline ( ut : * const utmpx ) -> * mut utmpx ;
555+ pub fn setutxent ( ) ;
556+ pub fn endutxent ( ) ;
557+ }
558+
501559#[ link( name = "util" ) ]
502560extern {
503561 pub fn sysctl ( name : * mut :: c_int ,
0 commit comments