| 1 | /* Structures and definitions for the user accounting database. GNU version. |
|---|
| 2 | Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. |
|---|
| 3 | This file is part of the GNU C Library. |
|---|
| 4 | |
|---|
| 5 | The GNU C Library is free software; you can redistribute it and/or |
|---|
| 6 | modify it under the terms of the GNU Lesser General Public |
|---|
| 7 | License as published by the Free Software Foundation; either |
|---|
| 8 | version 2.1 of the License, or (at your option) any later version. |
|---|
| 9 | |
|---|
| 10 | The GNU C Library is distributed in the hope that it will be useful, |
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | Lesser General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU Lesser General Public |
|---|
| 16 | License along with the GNU C Library; if not, write to the Free |
|---|
| 17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
|---|
| 18 | 02111-1307 USA. */ |
|---|
| 19 | |
|---|
| 20 | #ifndef _UTMPX_H |
|---|
| 21 | # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead." |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | #include <bits/types.h> |
|---|
| 25 | #include <sys/time.h> |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | #ifdef __USE_GNU |
|---|
| 29 | # include <paths.h> |
|---|
| 30 | # define _PATH_UTMPX _PATH_UTMP |
|---|
| 31 | # define _PATH_WTMPX _PATH_WTMP |
|---|
| 32 | #endif |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | #define __UT_LINESIZE 32 |
|---|
| 36 | #define __UT_NAMESIZE 32 |
|---|
| 37 | #define __UT_HOSTSIZE 256 |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | /* The structure describing the status of a terminated process. This |
|---|
| 41 | type is used in `struct utmpx' below. */ |
|---|
| 42 | struct __exit_status |
|---|
| 43 | { |
|---|
| 44 | #ifdef __USE_GNU |
|---|
| 45 | short int e_termination; /* Process termination status. */ |
|---|
| 46 | short int e_exit; /* Process exit status. */ |
|---|
| 47 | #else |
|---|
| 48 | short int __e_termination; /* Process termination status. */ |
|---|
| 49 | short int __e_exit; /* Process exit status. */ |
|---|
| 50 | #endif |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | /* The structure describing an entry in the user accounting database. */ |
|---|
| 55 | struct utmpx |
|---|
| 56 | { |
|---|
| 57 | short int ut_type; /* Type of login. */ |
|---|
| 58 | __pid_t ut_pid; /* Process ID of login process. */ |
|---|
| 59 | char ut_line[__UT_LINESIZE]; /* Devicename. */ |
|---|
| 60 | char ut_id[4]; /* Inittab ID. */ |
|---|
| 61 | char ut_user[__UT_NAMESIZE]; /* Username. */ |
|---|
| 62 | char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ |
|---|
| 63 | struct __exit_status ut_exit; /* Exit status of a process marked |
|---|
| 64 | as DEAD_PROCESS. */ |
|---|
| 65 | long int ut_session; /* Session ID, used for windowing. */ |
|---|
| 66 | struct timeval ut_tv; /* Time entry was made. */ |
|---|
| 67 | __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ |
|---|
| 68 | char __unused[20]; /* Reserved for future use. */ |
|---|
| 69 | }; |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | /* Values for the `ut_type' field of a `struct utmpx'. */ |
|---|
| 73 | #define EMPTY 0 /* No valid user accounting information. */ |
|---|
| 74 | |
|---|
| 75 | #ifdef __USE_GNU |
|---|
| 76 | # define RUN_LVL 1 /* The system's runlevel. */ |
|---|
| 77 | #endif |
|---|
| 78 | #define BOOT_TIME 2 /* Time of system boot. */ |
|---|
| 79 | #define NEW_TIME 3 /* Time after system clock changed. */ |
|---|
| 80 | #define OLD_TIME 4 /* Time when system clock changed. */ |
|---|
| 81 | |
|---|
| 82 | #define INIT_PROCESS 5 /* Process spawned by the init process. */ |
|---|
| 83 | #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ |
|---|
| 84 | #define USER_PROCESS 7 /* Normal process. */ |
|---|
| 85 | #define DEAD_PROCESS 8 /* Terminated process. */ |
|---|
| 86 | |
|---|
| 87 | #ifdef __USE_GNU |
|---|
| 88 | # define ACCOUNTING 9 /* System accounting. */ |
|---|
| 89 | #endif |
|---|