blob: 0b3f6232df2d0e68f8458c3b22b1d75c347e3037 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _UTMPX_H
2#define _UTMPX_H
3
4#ifdef __cplusplus
5extern "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 Felkerf5ba2bc2011-03-18 21:52:26 -040014#define UT_LINESIZE 32
15
Rich Felker0b44a032011-02-12 00:22:29 -050016struct utmpx
17{
18 short ut_type;
19 pid_t ut_pid;
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040020 char ut_line[UT_LINESIZE];
Rich Felker0b44a032011-02-12 00:22:29 -050021 char ut_id[4];
22 char ut_user[32];
23 char ut_host[256];
24 struct {
Rich Felker0729fd92011-04-12 12:03:33 -040025 short e_termination;
26 short e_exit;
27 } ut_exit;
Rich Felker0b44a032011-02-12 00:22:29 -050028 long ut_session;
29 struct timeval ut_tv;
30 unsigned ut_addr_v6[4];
31 char __unused[20];
32};
33
34void endutxent(void);
35struct utmpx *getutxent(void);
36struct utmpx *getutxid(const struct utmpx *);
37struct utmpx *getutxline(const struct utmpx *);
38struct utmpx *pututxline(const struct utmpx *);
39void setutxent(void);
40
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040041void updwtmpx(const char *, const struct utmpx *);
42
Rich Felker0b44a032011-02-12 00:22:29 -050043#define EMPTY 0
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040044#define RUN_LVL 1
Rich Felker0b44a032011-02-12 00:22:29 -050045#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