rework langinfo code for ABI compat and for use by time code
[musl] / include / utmpx.h
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_suseconds_t
11 #define __NEED_struct_timeval
12
13 #include <bits/alltypes.h>
14
15 #define UT_LINESIZE 32
16
17 struct utmpx
18 {
19         short ut_type;
20         pid_t ut_pid;
21         char ut_line[UT_LINESIZE];
22         char ut_id[4];
23         char ut_user[32];
24         char ut_host[256];
25         struct {
26                 short e_termination;
27                 short e_exit;
28         } ut_exit;
29         long ut_session;
30         struct timeval ut_tv;
31         unsigned ut_addr_v6[4];
32         char __unused[20];
33 };
34
35 void          endutxent(void);
36 struct utmpx *getutxent(void);
37 struct utmpx *getutxid(const struct utmpx *);
38 struct utmpx *getutxline(const struct utmpx *);
39 struct utmpx *pututxline(const struct utmpx *);
40 void          setutxent(void);
41
42 void updwtmpx(const char *, const struct utmpx *);
43
44 #define EMPTY           0
45 #define RUN_LVL         1
46 #define BOOT_TIME       2
47 #define NEW_TIME        3
48 #define OLD_TIME        4
49 #define INIT_PROCESS    5
50 #define LOGIN_PROCESS   6
51 #define USER_PROCESS    7
52 #define DEAD_PROCESS    8
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif