blob: 24e2da7bf9964407fe1afb283033289843f818bd [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 Felker0b44a032011-02-12 00:22:29 -050025#define utmpname(x) (-1)
Rich Felkera1527a02014-01-08 19:36:29 -050026#define e_exit __e_exit
27#define e_termination __e_termination
Rich Felker0b44a032011-02-12 00:22:29 -050028
Rich Felkereee150f2011-02-20 15:06:26 -050029void endutent(void);
30struct utmp *getutent(void);
31struct utmp *getutid(const struct utmp *);
32struct utmp *getutline(const struct utmp *);
33struct utmp *pututline(const struct utmp *);
34void setutent(void);
35
Rich Felkerf5ba2bc2011-03-18 21:52:26 -040036void updwtmp(const char *, const struct utmp *);
37
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