blob: 48a400d84dec3d17db76831b2036ba41cfe2ab2b [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _UTMP_H
2#define _UTMP_H
3
Rich Felkereee150f2011-02-20 15:06:26 -05004#ifdef __cplusplus
5extern "C" {
6#endif
7
Rich Felker0b44a032011-02-12 00:22:29 -05008#include <utmpx.h>
9
Rich Felkerfa3bbbd2012-01-31 14:39:17 -050010#define ACCOUNTING 9
Rich Felker96e0aca2012-02-01 14:10:38 -050011#define UT_NAMESIZE 32
Rich Felkerfa3bbbd2012-01-31 14:39:17 -050012#define UT_HOSTSIZE 256
Rich Felkera1527a02014-01-08 19:36:29 -050013#define UT_LINESIZE 32
Rich Felkerfa3bbbd2012-01-31 14:39:17 -050014
Rich Felker4a994402012-05-06 16:35:32 -040015struct lastlog {
16 time_t ll_time;
17 char ll_line[UT_LINESIZE];
18 char ll_host[UT_HOSTSIZE];
19};
20
Rich Felker0b44a032011-02-12 00:22:29 -050021#define ut_time ut_tv.tv_sec
22#define ut_name ut_user
Rich Felker1e2281b2013-06-27 20:00:29 -040023#define ut_addr ut_addr_v6[0]
Rich Felker0b44a032011-02-12 00:22:29 -050024#define utmp utmpx
Rich Felkera1527a02014-01-08 19:36:29 -050025#define e_exit __e_exit
26#define e_termination __e_termination
Rich Felker0b44a032011-02-12 00:22:29 -050027
Rich Felkereee150f2011-02-20 15:06:26 -050028void endutent(void);
29struct utmp *getutent(void);
30struct utmp *getutid(const struct utmp *);
31struct utmp *getutline(const struct utmp *);
32struct utmp *pututline(const struct utmp *);
33void setutent(void);
34
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040035void updwtmp(const char *, const struct utmp *);
Rich Felker692b16d2016-02-12 09:58:50 -050036int utmpname(const char *);
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040037
Felix Janda4b2cb372014-12-20 20:13:27 -050038int login_tty(int);
39
Rich Felker1e2281b2013-06-27 20:00:29 -040040#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 Felker0b44a032011-02-12 00:22:29 -050047
Rich Felkereee150f2011-02-20 15:06:26 -050048#ifdef __cplusplus
49}
50#endif
51
Rich Felker0b44a032011-02-12 00:22:29 -050052#endif