Skip to content

Commit b47e554

Browse files
author
Knight
committed
Add struct utmp for i686-linux
1 parent 62f9035 commit b47e554

File tree

1 file changed

+44
-0
lines changed
  • src/unix/notbsd/linux/other/b32

1 file changed

+44
-0
lines changed

src/unix/notbsd/linux/other/b32/mod.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ s! {
8383
pub mem_unit: ::c_uint,
8484
pub _f: [::c_char; 8],
8585
}
86+
87+
pub struct __exit_status {
88+
pub e_termination: ::c_short,
89+
pub e_exit: ::c_short,
90+
}
91+
92+
pub struct utmpx {
93+
pub ut_type: ::c_short,
94+
pub ut_pid: ::pid_t,
95+
pub ut_line: [::c_char; __UT_LINESIZE],
96+
pub ut_id: [::c_char; 4],
97+
98+
pub ut_user: [::c_char; __UT_NAMESIZE],
99+
pub ut_host: [::c_char; __UT_HOSTSIZE],
100+
pub ut_exit: __exit_status,
101+
pub ut_session: ::c_long,
102+
pub ut_tv: ::timeval,
103+
104+
pub ut_addr_v6: [::int32_t; 4],
105+
__glibc_reserved: [::c_char; 20],
106+
}
86107
}
87108

88109
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -97,6 +118,29 @@ pub const PTRACE_SETFPXREGS: ::c_uint = 19;
97118
pub const PTRACE_GETREGS: ::c_uint = 12;
98119
pub const PTRACE_SETREGS: ::c_uint = 13;
99120

121+
pub const __UT_LINESIZE: usize = 32;
122+
pub const __UT_NAMESIZE: usize = 32;
123+
pub const __UT_HOSTSIZE: usize = 256;
124+
pub const EMPTY: ::c_short = 0;
125+
pub const RUN_LVL: ::c_short = 1;
126+
pub const BOOT_TIME: ::c_short = 2;
127+
pub const NEW_TIME: ::c_short = 3;
128+
pub const OLD_TIME: ::c_short = 4;
129+
pub const INIT_PROCESS: ::c_short = 5;
130+
pub const LOGIN_PROCESS: ::c_short = 6;
131+
pub const USER_PROCESS: ::c_short = 7;
132+
pub const DEAD_PROCESS: ::c_short = 8;
133+
pub const ACCOUNTING: ::c_short = 9;
134+
135+
extern {
136+
pub fn getutxent() -> *mut utmpx;
137+
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
138+
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
139+
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
140+
pub fn setutxent();
141+
pub fn endutxent();
142+
}
143+
100144
cfg_if! {
101145
if #[cfg(target_arch = "x86")] {
102146
mod x86;

0 commit comments

Comments
 (0)