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 char ut_user[UT_NAMESIZE]; /* username, not null-term */ 34 char ut_host[UT_HOSTSIZE]; /* hostname for remote login... */ 35 long ut_addr; /* IP addr of remote host */ 36 37 }; 38 39 extern void setutent __P ((void)); 40 extern void utmpname __P ((__const char *)); 41 extern struct utmp * getutent __P ((void)); 42 extern struct utmp * getutid __P ((__const struct utmp *)); 43 extern struct utmp * getutline __P ((__const struct utmp *)); 44 extern struct utmp * pututline __P ((__const struct utmp *)); 45 extern void endutent __P ((void)); 46 47 #ifdef __LIBC__ 48 struct utmp * __getutent __P ((int)); 49 #endif 50 51 #endif /* __UTMP_H */ 52 53