]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/common/bits/utmp.h
Update
[l4.git] / l4 / pkg / l4re-core / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / common / bits / utmp.h
1 /* The `struct utmp' type, describing entries in the utmp file.  GNU version.
2    Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
3    Free Software Foundation, Inc.
4    This file is part of the GNU C Library.
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, see
18    <http://www.gnu.org/licenses/>.  */
19
20 #ifndef _UTMP_H
21 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
22 #endif
23
24 #include <paths.h>
25 #include <sys/time.h>
26 #include <sys/types.h>
27 #include <bits/wordsize.h>
28
29
30 #define UT_LINESIZE     32
31 #define UT_NAMESIZE     32
32 #define UT_HOSTSIZE     256
33
34
35 /* The structure describing an entry in the database of
36    previous logins.  */
37 struct lastlog
38   {
39 #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
40     int32_t ll_time;
41 #else
42     __time_t ll_time;
43 #endif
44     char ll_line[UT_LINESIZE];
45     char ll_host[UT_HOSTSIZE];
46   };
47
48
49 /* The structure describing the status of a terminated process.  This
50    type is used in `struct utmp' below.  */
51 struct exit_status
52   {
53     short int e_termination;    /* Process termination status.  */
54     short int e_exit;           /* Process exit status.  */
55   };
56
57
58 /* The structure describing an entry in the user accounting database.  */
59 struct utmp
60 {
61   short int ut_type;            /* Type of login.  */
62   pid_t ut_pid;                 /* Process ID of login process.  */
63   char ut_line[UT_LINESIZE];    /* Devicename.  */
64   char ut_id[4];                /* Inittab ID.  */
65   char ut_user[UT_NAMESIZE];    /* Username.  */
66   char ut_host[UT_HOSTSIZE];    /* Hostname for remote login.  */
67   struct exit_status ut_exit;   /* Exit status of a process marked
68                                    as DEAD_PROCESS.  */
69 /* The ut_session and ut_tv fields must be the same size when compiled
70    32- and 64-bit.  This allows data files and shared memory to be
71    shared between 32- and 64-bit applications.  */
72 #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
73   int32_t ut_session;           /* Session ID, used for windowing.  */
74   struct
75   {
76     int32_t tv_sec;             /* Seconds.  */
77     int32_t tv_usec;            /* Microseconds.  */
78   } ut_tv;                      /* Time entry was made.  */
79 #else
80   long int ut_session;          /* Session ID, used for windowing.  */
81   struct timeval ut_tv;         /* Time entry was made.  */
82 #endif
83
84   int32_t ut_addr_v6[4];        /* Internet address of remote host.  */
85   char __unused[20];            /* Reserved for future use.  */
86 };
87
88 /* Backwards compatibility hacks.  */
89 #define ut_name         ut_user
90 #ifndef _NO_UT_TIME
91 /* We have a problem here: `ut_time' is also used otherwise.  Define
92    _NO_UT_TIME if the compiler complains.  */
93 # define ut_time        ut_tv.tv_sec
94 #endif
95 #define ut_xtime        ut_tv.tv_sec
96 #define ut_addr         ut_addr_v6[0]
97
98
99 /* Values for the `ut_type' field of a `struct utmp'.  */
100 #define EMPTY           0       /* No valid user accounting information.  */
101
102 #define RUN_LVL         1       /* The system's runlevel.  */
103 #define BOOT_TIME       2       /* Time of system boot.  */
104 #define NEW_TIME        3       /* Time after system clock changed.  */
105 #define OLD_TIME        4       /* Time when system clock changed.  */
106
107 #define INIT_PROCESS    5       /* Process spawned by the init process.  */
108 #define LOGIN_PROCESS   6       /* Session leader of a logged in user.  */
109 #define USER_PROCESS    7       /* Normal process.  */
110 #define DEAD_PROCESS    8       /* Terminated process.  */
111
112 #define ACCOUNTING      9
113
114 /* Old Linux name for the EMPTY type.  */
115 #define UT_UNKNOWN      EMPTY
116
117
118 /* Tell the user that we have a modern system with UT_HOST, UT_PID,
119    UT_TYPE, UT_ID and UT_TV fields.  */
120 #define _HAVE_UT_TYPE   1
121 #define _HAVE_UT_PID    1
122 #define _HAVE_UT_ID     1
123 #define _HAVE_UT_TV     1
124 #define _HAVE_UT_HOST   1