Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / unix / sysv / linux / s390 / bits / utmp.h
blob5a40a4142a6da1304d18e47aeef6a739e32ae366
1 /* The `struct utmp' type, describing entries in the utmp file. GNU version.
2 Copyright (C) 1993-2014 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _UTMP_H
20 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
21 #endif
23 #include <paths.h>
24 #include <sys/time.h>
25 #include <sys/types.h>
26 #include <bits/wordsize.h>
29 #define UT_LINESIZE 32
30 #define UT_NAMESIZE 32
31 #define UT_HOSTSIZE 256
34 /* The structure describing an entry in the database of
35 previous logins. */
36 struct lastlog
38 #if __WORDSIZE == 32
39 int64_t ll_time;
40 #else
41 __time_t ll_time;
42 #endif
43 char ll_line[UT_LINESIZE];
44 char ll_host[UT_HOSTSIZE];
48 /* The structure describing the status of a terminated process. This
49 type is used in `struct utmp' below. */
50 struct exit_status
52 short int e_termination; /* Process termination status. */
53 short int e_exit; /* Process exit status. */
57 /* The structure describing an entry in the user accounting database. */
58 struct utmp
60 short int ut_type; /* Type of login. */
61 pid_t ut_pid; /* Process ID of login process. */
62 char ut_line[UT_LINESIZE]; /* Devicename. */
63 char ut_id[4]; /* Inittab ID. */
64 char ut_user[UT_NAMESIZE]; /* Username. */
65 char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
66 struct exit_status ut_exit; /* Exit status of a process marked
67 as DEAD_PROCESS. */
68 /* The ut_session and ut_tv fields must be the same size when compiled
69 32- and 64-bit. This allows data files and shared memory to be
70 shared between 32- and 64-bit applications. */
71 #if __WORDSIZE == 32
72 int64_t ut_session; /* Session ID, used for windowing. */
73 struct
75 int64_t tv_sec; /* Seconds. */
76 int64_t tv_usec; /* Microseconds. */
77 } ut_tv; /* Time entry was made. */
78 #else
79 long int ut_session; /* Session ID, used for windowing. */
80 struct timeval ut_tv; /* Time entry was made. */
81 #endif
83 int32_t ut_addr_v6[4]; /* Internet address of remote host. */
84 char __glibc_reserved[20]; /* Reserved for future use. */
87 /* Backwards compatibility hacks. */
88 #define ut_name ut_user
89 #ifndef _NO_UT_TIME
90 /* We have a problem here: `ut_time' is also used otherwise. Define
91 _NO_UT_TIME if the compiler complains. */
92 # define ut_time ut_tv.tv_sec
93 #endif
94 #define ut_xtime ut_tv.tv_sec
95 #define ut_addr ut_addr_v6[0]
98 /* Values for the `ut_type' field of a `struct utmp'. */
99 #define EMPTY 0 /* No valid user accounting information. */
101 #define RUN_LVL 1 /* The system's runlevel. */
102 #define BOOT_TIME 2 /* Time of system boot. */
103 #define NEW_TIME 3 /* Time after system clock changed. */
104 #define OLD_TIME 4 /* Time when system clock changed. */
106 #define INIT_PROCESS 5 /* Process spawned by the init process. */
107 #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
108 #define USER_PROCESS 7 /* Normal process. */
109 #define DEAD_PROCESS 8 /* Terminated process. */
111 #define ACCOUNTING 9
113 /* Old Linux name for the EMPTY type. */
114 #define UT_UNKNOWN EMPTY
117 /* Tell the user that we have a modern system with UT_HOST, UT_PID,
118 UT_TYPE, UT_ID and UT_TV fields. */
119 #define _HAVE_UT_TYPE 1
120 #define _HAVE_UT_PID 1
121 #define _HAVE_UT_ID 1
122 #define _HAVE_UT_TV 1
123 #define _HAVE_UT_HOST 1