1 /* 2 * Copyright 2020 Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _UTMPX_H_ 6 #define _UTMPX_H_ 7 8 9 #include <sys/time.h> 10 #include <sys/types.h> 11 12 13 struct utmpx { 14 short ut_type; /* type of entry */ 15 struct timeval ut_tv; /* modification time */ 16 char ut_id[8]; /* entry identifier */ 17 pid_t ut_pid; /* process ID */ 18 char ut_user[32]; /* user login name */ 19 char ut_line[16]; /* device name */ 20 char __ut_reserved[192]; 21 }; 22 23 24 #define EMPTY 0 /* No valid user accounting information. */ 25 #define BOOT_TIME 1 /* Identifies time of system boot. */ 26 #define OLD_TIME 2 /* Identifies time when system clock changed. */ 27 #define NEW_TIME 3 /* Identifies time after system clock changed. */ 28 #define USER_PROCESS 4 /* Identifies a process. */ 29 #define INIT_PROCESS 5 /* Identifies a process spawned by the init process. */ 30 #define LOGIN_PROCESS 6 /* Identifies the session leader of a logged-in user. */ 31 #define DEAD_PROCESS 7 /* Identifies a session leader who has exited. */ 32 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 void endutxent(void); 39 struct utmpx* getutxent(void); 40 struct utmpx* getutxid(const struct utmpx *); 41 struct utmpx* getutxline(const struct utmpx *); 42 struct utmpx* pututxline(const struct utmpx *); 43 void setutxent(void); 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif /* _UTMPX_H_ */ 50