]>
Commit | Line | Data |
---|---|---|
64bc6412 EA |
1 | /* utmp.h */ |
2 | ||
3 | #ifndef __UTMP_H | |
4 | #define __UTMP_H | |
5 | ||
6 | #include <features.h> | |
7 | #include <sys/types.h> | |
8 | #include <paths.h> | |
9 | #include <time.h> | |
10 | ||
11 | #define UT_UNKNOWN 0 | |
12 | #define UT_LINESIZE 12 | |
13 | #define UT_NAMESIZE 8 | |
14 | #define UT_HOSTSIZE 16 | |
15 | ||
16 | #define RUN_LVL 1 | |
17 | #define BOOT_TIME 2 | |
18 | #define NEW_TIME 3 | |
19 | #define OLD_TIME 4 | |
20 | ||
21 | #define INIT_PROCESS 5 | |
22 | #define LOGIN_PROCESS 6 | |
23 | #define USER_PROCESS 7 | |
24 | #define DEAD_PROCESS 8 | |
25 | ||
ce8ee8d9 DM |
26 | __BEGIN_DECLS |
27 | ||
64bc6412 EA |
28 | struct utmp |
29 | { | |
30 | short ut_type; /* type of login */ | |
31 | pid_t ut_pid; /* pid of login-process */ | |
32 | char ut_line[UT_LINESIZE]; /* devicename of tty -"/dev/", null-term */ | |
33 | char ut_id[2]; /* abbrev. ttyname, as 01, s1 etc. */ | |
34 | time_t ut_time; /* login time */ | |
bb84a07a | 35 | #define ut_name ut_user /* Backwards compatibility hack */ |
64bc6412 EA |
36 | char ut_user[UT_NAMESIZE]; /* username, not null-term */ |
37 | char ut_host[UT_HOSTSIZE]; /* hostname for remote login... */ | |
38 | long ut_addr; /* IP addr of remote host */ | |
39 | ||
40 | }; | |
41 | ||
42 | extern void setutent __P ((void)); | |
43 | extern void utmpname __P ((__const char *)); | |
44 | extern struct utmp * getutent __P ((void)); | |
45 | extern struct utmp * getutid __P ((struct utmp *)); | |
46 | extern struct utmp * getutline __P ((struct utmp *)); | |
47 | extern struct utmp * pututline __P ((struct utmp *)); | |
48 | extern void endutent __P ((void)); | |
a3e03be0 EA |
49 | extern int login_tty (int __fd); |
50 | extern void login (const struct utmp *entry); | |
51 | extern void logwtmp (const char *line, const char *name, const char *host); | |
64bc6412 | 52 | |
62787816 | 53 | #ifdef _LIBC |
64bc6412 EA |
54 | struct utmp * __getutent __P ((int)); |
55 | #endif | |
56 | ||
ce8ee8d9 DM |
57 | __END_DECLS |
58 | ||
64bc6412 EA |
59 | #endif /* __UTMP_H */ |
60 |