xref: /haiku/headers/posix/utmpx.h (revision 1a76488fc88584bf66b9751d7fb9b6527ac20d87)
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_host[128];	/* remote hostname */
21 	char			__ut_reserved[64];
22 };
23 
24 
25 #define	EMPTY			0	/* No valid user accounting information. */
26 #define	BOOT_TIME		1	/* Identifies time of system boot. */
27 #define	OLD_TIME		2	/* Identifies time when system clock changed. */
28 #define	NEW_TIME		3	/* Identifies time after system clock changed. */
29 #define	USER_PROCESS	4	/* Identifies a process. */
30 #define	INIT_PROCESS	5	/* Identifies a process spawned by the init process. */
31 #define	LOGIN_PROCESS	6	/* Identifies the session leader of a logged-in user. */
32 #define	DEAD_PROCESS	7	/* Identifies a session leader who has exited. */
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 void endutxent(void);
40 struct utmpx* getutxent(void);
41 struct utmpx* getutxid(const struct utmpx *);
42 struct utmpx* getutxline(const struct utmpx *);
43 struct utmpx* pututxline(const struct utmpx *);
44 void setutxent(void);
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif	/* _UTMPX_H_ */
51