utmpx.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. short __ut_pad1;
  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. #if __BYTE_ORDER == 1234
  25. int ut_session, __ut_pad2;
  26. #else
  27. int __ut_pad2, ut_session;
  28. #endif
  29. struct timeval ut_tv;
  30. unsigned ut_addr_v6[4];
  31. char __unused[20];
  32. };
  33. void endutxent(void);
  34. struct utmpx *getutxent(void);
  35. struct utmpx *getutxid(const struct utmpx *);
  36. struct utmpx *getutxline(const struct utmpx *);
  37. struct utmpx *pututxline(const struct utmpx *);
  38. void setutxent(void);
  39. #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
  40. #define e_exit __e_exit
  41. #define e_termination __e_termination
  42. void updwtmpx(const char *, const struct utmpx *);
  43. int utmpxname(const char *);
  44. #endif
  45. #define EMPTY 0
  46. #define RUN_LVL 1
  47. #define BOOT_TIME 2
  48. #define NEW_TIME 3
  49. #define OLD_TIME 4
  50. #define INIT_PROCESS 5
  51. #define LOGIN_PROCESS 6
  52. #define USER_PROCESS 7
  53. #define DEAD_PROCESS 8
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif