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