1
0

utmpx.h 1.0 KB

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