utmp.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* utmp.h */
  2. #ifndef __UTMP_H
  3. #define __UTMP_H
  4. #include <features.h>
  5. #include <sys/types.h>
  6. #include <paths.h>
  7. #include <time.h>
  8. #define UT_UNKNOWN 0
  9. #define UT_LINESIZE 12
  10. #define UT_NAMESIZE 8
  11. #define UT_HOSTSIZE 16
  12. #define RUN_LVL 1
  13. #define BOOT_TIME 2
  14. #define NEW_TIME 3
  15. #define OLD_TIME 4
  16. #define INIT_PROCESS 5
  17. #define LOGIN_PROCESS 6
  18. #define USER_PROCESS 7
  19. #define DEAD_PROCESS 8
  20. struct utmp
  21. {
  22. short ut_type; /* type of login */
  23. pid_t ut_pid; /* pid of login-process */
  24. char ut_line[UT_LINESIZE]; /* devicename of tty -"/dev/", null-term */
  25. char ut_id[2]; /* abbrev. ttyname, as 01, s1 etc. */
  26. time_t ut_time; /* login time */
  27. char ut_user[UT_NAMESIZE]; /* username, not null-term */
  28. char ut_host[UT_HOSTSIZE]; /* hostname for remote login... */
  29. long ut_addr; /* IP addr of remote host */
  30. };
  31. extern void setutent __P ((void));
  32. extern void utmpname __P ((__const char *));
  33. extern struct utmp * getutent __P ((void));
  34. extern struct utmp * getutid __P ((struct utmp *));
  35. extern struct utmp * getutline __P ((struct utmp *));
  36. extern struct utmp * pututline __P ((struct utmp *));
  37. extern void endutent __P ((void));
  38. #ifdef __LIBC__
  39. struct utmp * __getutent __P ((int));
  40. #endif
  41. #endif /* __UTMP_H */