]> sourceware.org Git - glibc.git/blob - sysdeps/gnu/bits/utmpx.h
Update.
[glibc.git] / sysdeps / gnu / bits / utmpx.h
1 /* Structures and defenitions for the user accounting database. GNU version.
2 Copyright (C) 1997, 1998 Free Software Foundation, Inc.
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
20 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
21 #endif
22
23 #include <bits/types.h>
24 #include <sys/time.h>
25
26
27 #ifdef __USE_GNU
28 # include <paths.h>
29 # define _PATH_UTMPX _PATH_UTMP
30 # define _PATH_WTMPX _PATH_WTMP
31 #endif
32
33
34 #define __UT_LINESIZE 32
35 #define __UT_NAMESIZE 32
36 #define __UT_HOSTSIZE 256
37
38
39 /* The structure describing the status of a terminated process. This
40 type is used in `struct utmpx' below. */
41 struct __exit_status
42 {
43 #ifdef __USE_GNU
44 short int e_termination; /* Process termination status. */
45 short int e_exit; /* Process exit status. */
46 #else
47 short int __e_termination; /* Process termination status. */
48 short int __e_exit; /* Process exit status. */
49 #endif
50 };
51
52
53 /* The structure describing an entry in the user accounting database. */
54 struct utmpx
55 {
56 short int ut_type; /* Type of login. */
57 __pid_t ut_pid; /* Process ID of login process. */
58 char ut_line[__UT_LINESIZE]; /* Devicename. */
59 char ut_id[4]; /* Inittab ID. */
60 char ut_user[__UT_NAMESIZE]; /* Username. */
61 char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
62 struct __exit_status ut_exit; /* Exit status of a process marked
63 as DEAD_PROCESS. */
64 long int ut_session; /* Session ID, used for windowing. */
65 struct timeval ut_tv; /* Time entry was made. */
66 __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
67 char __unused[20]; /* Reserved for future use. */
68 };
69
70
71 /* Values for the `ut_type' field of a `struct utmpx'. */
72 #define EMPTY 0 /* No valid user accounting information. */
73
74 #define RUN_LVL 1 /* The system's runlevel. */
75 #define BOOT_TIME 2 /* Time of system boot. */
76 #define NEW_TIME 3 /* Time after system clock changed. */
77 #define OLD_TIME 4 /* Time when system clock changed. */
78
79 #define INIT_PROCESS 5 /* Process spawned by the init process. */
80 #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
81 #define USER_PROCESS 7 /* Normal process. */
82 #define DEAD_PROCESS 8 /* Terminated process. */
83
84 #ifdef __USE_GNU
85 # define ACCOUNTING 9 /* System accounting. */
86 #endif
This page took 0.040029 seconds and 5 git commands to generate.