Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _UTMPX_H |
| 2 | #define _UTMPX_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #define __NEED_pid_t |
| 9 | #define __NEED_time_t |
| 10 | #define __NEED_struct_timeval |
| 11 | |
| 12 | #include <bits/alltypes.h> |
| 13 | |
Rich Felker | f5ba2bc | 2011-03-18 21:52:26 -0400 | [diff] [blame] | 14 | #define UT_LINESIZE 32 |
| 15 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 16 | struct utmpx |
| 17 | { |
| 18 | short ut_type; |
| 19 | pid_t ut_pid; |
Rich Felker | f5ba2bc | 2011-03-18 21:52:26 -0400 | [diff] [blame] | 20 | char ut_line[UT_LINESIZE]; |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 21 | char ut_id[4]; |
| 22 | char ut_user[32]; |
| 23 | char ut_host[256]; |
| 24 | struct { |
Rich Felker | 0729fd9 | 2011-04-12 12:03:33 -0400 | [diff] [blame] | 25 | short e_termination; |
| 26 | short e_exit; |
| 27 | } ut_exit; |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 28 | long ut_session; |
| 29 | struct timeval ut_tv; |
| 30 | unsigned ut_addr_v6[4]; |
| 31 | char __unused[20]; |
| 32 | }; |
| 33 | |
| 34 | void endutxent(void); |
| 35 | struct utmpx *getutxent(void); |
| 36 | struct utmpx *getutxid(const struct utmpx *); |
| 37 | struct utmpx *getutxline(const struct utmpx *); |
| 38 | struct utmpx *pututxline(const struct utmpx *); |
| 39 | void setutxent(void); |
| 40 | |
Rich Felker | f5ba2bc | 2011-03-18 21:52:26 -0400 | [diff] [blame] | 41 | void updwtmpx(const char *, const struct utmpx *); |
| 42 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 43 | #define EMPTY 0 |
Rich Felker | f5ba2bc | 2011-03-18 21:52:26 -0400 | [diff] [blame] | 44 | #define RUN_LVL 1 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 45 | #define BOOT_TIME 2 |
| 46 | #define NEW_TIME 3 |
| 47 | #define OLD_TIME 4 |
| 48 | #define INIT_PROCESS 5 |
| 49 | #define LOGIN_PROCESS 6 |
| 50 | #define USER_PROCESS 7 |
| 51 | #define DEAD_PROCESS 8 |
| 52 | |
| 53 | #ifdef __cplusplus |
| 54 | } |
| 55 | #endif |
| 56 | |
| 57 | #endif |