fix unprotected macro argument in sys/ttydefaults.h
[oweals/musl.git] / include / utmpx.h
1 #ifndef _UTMPX_H
2 #define _UTMPX_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <features.h>
9
10 #define __NEED_pid_t
11 #define __NEED_time_t
12 #define __NEED_suseconds_t
13 #define __NEED_struct_timeval
14
15 #include <bits/alltypes.h>
16
17 struct utmpx {
18         short ut_type;
19         short __ut_pad1;
20         pid_t ut_pid;
21         char ut_line[32];
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 #if __BYTE_ORDER == 1234
30         int ut_session, __ut_pad2;
31 #else
32         int __ut_pad2, ut_session;
33 #endif
34         struct timeval ut_tv;
35         unsigned ut_addr_v6[4];
36         char __unused[20];
37 };
38
39 void          endutxent(void);
40 struct utmpx *getutxent(void);
41 struct utmpx *getutxid(const struct utmpx *);
42 struct utmpx *getutxline(const struct utmpx *);
43 struct utmpx *pututxline(const struct utmpx *);
44 void          setutxent(void);
45
46 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
47 #define e_exit __e_exit
48 #define e_termination __e_termination
49 void updwtmpx(const char *, const struct utmpx *);
50 int utmpxname(const char *);
51 #endif
52
53 #define EMPTY           0
54 #define RUN_LVL         1
55 #define BOOT_TIME       2
56 #define NEW_TIME        3
57 #define OLD_TIME        4
58 #define INIT_PROCESS    5
59 #define LOGIN_PROCESS   6
60 #define USER_PROCESS    7
61 #define DEAD_PROCESS    8
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif