1
0

utmpx.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _UTMPX_H
  2. #define _UTMPX_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define __NEED_pid_t
  7. #define __NEED_time_t
  8. #define __NEED_struct_timeval
  9. #include <bits/alltypes.h>
  10. #define UT_LINESIZE 32
  11. struct utmpx
  12. {
  13. short ut_type;
  14. pid_t ut_pid;
  15. char ut_line[UT_LINESIZE];
  16. char ut_id[4];
  17. char ut_user[32];
  18. char ut_host[256];
  19. struct {
  20. short e_termination;
  21. short e_exit;
  22. } ut_exit;
  23. long ut_session;
  24. struct timeval ut_tv;
  25. unsigned ut_addr_v6[4];
  26. char __unused[20];
  27. };
  28. void endutxent(void);
  29. struct utmpx *getutxent(void);
  30. struct utmpx *getutxid(const struct utmpx *);
  31. struct utmpx *getutxline(const struct utmpx *);
  32. struct utmpx *pututxline(const struct utmpx *);
  33. void setutxent(void);
  34. void updwtmpx(const char *, const struct utmpx *);
  35. #define EMPTY 0
  36. #define RUN_LVL 1
  37. #define BOOT_TIME 2
  38. #define NEW_TIME 3
  39. #define OLD_TIME 4
  40. #define INIT_PROCESS 5
  41. #define LOGIN_PROCESS 6
  42. #define USER_PROCESS 7
  43. #define DEAD_PROCESS 8
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif