OSDN Git Service

Add a sneaky backwards compat hack from Michael Shmulevich
[uclinux-h8/uClibc.git] / include / utmp.h
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
26 struct utmp
27 {
28   short   ut_type;                 /* type of login */
29   pid_t   ut_pid;                  /* pid of login-process */
30   char    ut_line[UT_LINESIZE];    /* devicename of tty -"/dev/", null-term */
31   char    ut_id[2];                /* abbrev. ttyname, as 01, s1 etc. */
32   time_t  ut_time;                 /* login time */
33 #define ut_name ut_user                /* Backwards compatibility hack  */
34   char    ut_user[UT_NAMESIZE];    /* username, not null-term */
35   char    ut_host[UT_HOSTSIZE];    /* hostname for remote login... */
36   long    ut_addr;                 /* IP addr of remote host */
37
38 };
39
40 extern void             setutent __P ((void));
41 extern void             utmpname __P ((__const char *));
42 extern struct utmp *    getutent __P ((void));
43 extern struct utmp *    getutid __P ((struct utmp *));
44 extern struct utmp *    getutline __P ((struct utmp *));
45 extern struct utmp *    pututline __P ((struct utmp *));
46 extern void             endutent __P ((void));
47
48 #ifdef __LIBC__
49 struct utmp *           __getutent __P ((int));
50 #endif
51
52 #endif /* __UTMP_H */
53