Skip to content

Commit

Permalink
Auto merge of rust-lang#2460 - GrayJack:haiku-utmpx, r=JohnTitor
Browse files Browse the repository at this point in the history
Haiku: Add utmpx functions and constants

Progressing further on rust-lang#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)
  • Loading branch information
bors committed Oct 17, 2021
2 parents 20e5295 + 9258ae3 commit 133aeb8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,16 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;

// utmpx entry types
pub const EMPTY: ::c_short = 0;
pub const BOOT_TIME: ::c_short = 1;
pub const OLD_TIME: ::c_short = 2;
pub const NEW_TIME: ::c_short = 3;
pub const USER_PROCESS: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const DEAD_PROCESS: ::c_short = 7;

pub const LOG_PID: ::c_int = 1 << 12;
pub const LOG_CONS: ::c_int = 2 << 12;
pub const LOG_ODELAY: ::c_int = 4 << 12;
Expand Down Expand Up @@ -1622,6 +1632,12 @@ extern "C" {
) -> ::pid_t;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
pub fn setutxent();
pub fn endutxent();
}

cfg_if! {
Expand Down

0 comments on commit 133aeb8

Please sign in to comment.