utmpx.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _UTMPX_H
  2. #define _UTMPX_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define __NEED_pid_t
  8. #define __NEED_time_t
  9. #define __NEED_suseconds_t
  10. #define __NEED_struct_timeval
  11. #include <bits/alltypes.h>
  12. struct utmpx
  13. {
  14. short ut_type;
  15. pid_t ut_pid;
  16. char ut_line[32];
  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. #if defined(_BSD_SOURCE) | defined(_GNU_SOURCE)
  36. #define e_exit __e_exit
  37. #define e_termination __e_termination
  38. void updwtmpx(const char *, const struct utmpx *);
  39. int utmpxname(const char *);
  40. #endif
  41. #define EMPTY 0
  42. #define RUN_LVL 1
  43. #define BOOT_TIME 2
  44. #define NEW_TIME 3
  45. #define OLD_TIME 4
  46. #define INIT_PROCESS 5
  47. #define LOGIN_PROCESS 6
  48. #define USER_PROCESS 7
  49. #define DEAD_PROCESS 8
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif