utmpx.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. short ut_type;
  14. pid_t ut_pid;
  15. char ut_line[32];
  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. #if defined(_BSD_SOURCE) | defined(_GNU_SOURCE)
  35. #define e_exit __e_exit
  36. #define e_termination __e_termination
  37. void updwtmpx(const char *, const struct utmpx *);
  38. int utmpxname(const char *);
  39. #endif
  40. #define EMPTY 0
  41. #define RUN_LVL 1
  42. #define BOOT_TIME 2
  43. #define NEW_TIME 3
  44. #define OLD_TIME 4
  45. #define INIT_PROCESS 5
  46. #define LOGIN_PROCESS 6
  47. #define USER_PROCESS 7
  48. #define DEAD_PROCESS 8
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif