Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _UTMP_H |
| 2 | #define _UTMP_H |
| 3 | |
Rich Felker | eee150f | 2011-02-20 15:06:26 -0500 | [diff] [blame] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 8 | #include <utmpx.h> |
| 9 | |
Rich Felker | fa3bbbd | 2012-01-31 14:39:17 -0500 | [diff] [blame] | 10 | #define ACCOUNTING 9 |
Rich Felker | 96e0aca | 2012-02-01 14:10:38 -0500 | [diff] [blame] | 11 | #define UT_NAMESIZE 32 |
Rich Felker | fa3bbbd | 2012-01-31 14:39:17 -0500 | [diff] [blame] | 12 | #define UT_HOSTSIZE 256 |
Rich Felker | a1527a0 | 2014-01-08 19:36:29 -0500 | [diff] [blame] | 13 | #define UT_LINESIZE 32 |
Rich Felker | fa3bbbd | 2012-01-31 14:39:17 -0500 | [diff] [blame] | 14 | |
Rich Felker | 4a99440 | 2012-05-06 16:35:32 -0400 | [diff] [blame] | 15 | struct lastlog { |
| 16 | time_t ll_time; |
| 17 | char ll_line[UT_LINESIZE]; |
| 18 | char ll_host[UT_HOSTSIZE]; |
| 19 | }; |
| 20 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 21 | #define ut_time ut_tv.tv_sec |
| 22 | #define ut_name ut_user |
Rich Felker | 1e2281b | 2013-06-27 20:00:29 -0400 | [diff] [blame] | 23 | #define ut_addr ut_addr_v6[0] |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 24 | #define utmp utmpx |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 25 | #define utmpname(x) (-1) |
Rich Felker | a1527a0 | 2014-01-08 19:36:29 -0500 | [diff] [blame] | 26 | #define e_exit __e_exit |
| 27 | #define e_termination __e_termination |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 28 | |
Rich Felker | eee150f | 2011-02-20 15:06:26 -0500 | [diff] [blame] | 29 | void endutent(void); |
| 30 | struct utmp *getutent(void); |
| 31 | struct utmp *getutid(const struct utmp *); |
| 32 | struct utmp *getutline(const struct utmp *); |
| 33 | struct utmp *pututline(const struct utmp *); |
| 34 | void setutent(void); |
| 35 | |
Rich Felker | f5ba2bc | 2011-03-18 21:52:26 -0400 | [diff] [blame] | 36 | void updwtmp(const char *, const struct utmp *); |
| 37 | |
Felix Janda | 4b2cb37 | 2014-12-20 20:13:27 -0500 | [diff] [blame^] | 38 | int login_tty(int); |
| 39 | |
Rich Felker | 1e2281b | 2013-06-27 20:00:29 -0400 | [diff] [blame] | 40 | #define _PATH_UTMP "/dev/null/utmp" |
| 41 | #define _PATH_WTMP "/dev/null/wtmp" |
| 42 | |
| 43 | #define UTMP_FILE _PATH_UTMP |
| 44 | #define WTMP_FILE _PATH_WTMP |
| 45 | #define UTMP_FILENAME _PATH_UTMP |
| 46 | #define WTMP_FILENAME _PATH_WTMP |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 47 | |
Rich Felker | eee150f | 2011-02-20 15:06:26 -0500 | [diff] [blame] | 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 52 | #endif |