Skip to content

Commit 133aeb8

Browse files
committed
Auto merge of #2460 - GrayJack:haiku-utmpx, r=JohnTitor
Haiku: Add utmpx functions and constants Progressing further on #2429 adding functions and constants related to the `utmpx` structure [Haiku headers for reference](https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f331814273e5857555020f/headers/posix/utmpx.h#L13)
2 parents 20e5295 + 9258ae3 commit 133aeb8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/unix/haiku/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,16 @@ pub const PRIO_PROCESS: ::c_int = 0;
13181318
pub const PRIO_PGRP: ::c_int = 1;
13191319
pub const PRIO_USER: ::c_int = 2;
13201320

1321+
// utmpx entry types
1322+
pub const EMPTY: ::c_short = 0;
1323+
pub const BOOT_TIME: ::c_short = 1;
1324+
pub const OLD_TIME: ::c_short = 2;
1325+
pub const NEW_TIME: ::c_short = 3;
1326+
pub const USER_PROCESS: ::c_short = 4;
1327+
pub const INIT_PROCESS: ::c_short = 5;
1328+
pub const LOGIN_PROCESS: ::c_short = 6;
1329+
pub const DEAD_PROCESS: ::c_short = 7;
1330+
13211331
pub const LOG_PID: ::c_int = 1 << 12;
13221332
pub const LOG_CONS: ::c_int = 2 << 12;
13231333
pub const LOG_ODELAY: ::c_int = 4 << 12;
@@ -1622,6 +1632,12 @@ extern "C" {
16221632
) -> ::pid_t;
16231633
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
16241634
pub fn uname(buf: *mut ::utsname) -> ::c_int;
1635+
pub fn getutxent() -> *mut utmpx;
1636+
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
1637+
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
1638+
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
1639+
pub fn setutxent();
1640+
pub fn endutxent();
16251641
}
16261642

16271643
cfg_if! {

0 commit comments

Comments
 (0)