2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / s390 / bits / utmpx.h
blob718e29039ef2be77849f3b931dad25bd57f9ab82
1 /* Structures and definitions for the user accounting database. GNU version.
2 Copyright (C) 1997, 1998, 2000, 2001, 2002, 2008
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
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.
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.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #ifndef _UTMPX_H
22 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
23 #endif
25 #include <bits/types.h>
26 #include <sys/time.h>
27 #include <bits/wordsize.h>
30 #ifdef __USE_GNU
31 # include <paths.h>
32 # define _PATH_UTMPX _PATH_UTMP
33 # define _PATH_WTMPX _PATH_WTMP
34 #endif
37 #define __UT_LINESIZE 32
38 #define __UT_NAMESIZE 32
39 #define __UT_HOSTSIZE 256
42 /* The structure describing the status of a terminated process. This
43 type is used in `struct utmpx' below. */
44 struct __exit_status
46 #ifdef __USE_GNU
47 short int e_termination; /* Process termination status. */
48 short int e_exit; /* Process exit status. */
49 #else
50 short int __e_termination; /* Process termination status. */
51 short int __e_exit; /* Process exit status. */
52 #endif
56 /* The structure describing an entry in the user accounting database. */
57 struct utmpx
59 short int ut_type; /* Type of login. */
60 __pid_t ut_pid; /* Process ID of login process. */
61 char ut_line[__UT_LINESIZE]; /* Devicename. */
62 char ut_id[4]; /* Inittab ID. */
63 char ut_user[__UT_NAMESIZE]; /* Username. */
64 char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
65 struct __exit_status ut_exit; /* Exit status of a process marked
66 as DEAD_PROCESS. */
68 /* The fields ut_session and ut_tv must be the same size when compiled
69 32- and 64-bit. This allows files and shared memory to be shared
70 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
82 __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
83 char __unused[20]; /* Reserved for future use. */
87 /* Values for the `ut_type' field of a `struct utmpx'. */
88 #define EMPTY 0 /* No valid user accounting information. */
90 #ifdef __USE_GNU
91 # define RUN_LVL 1 /* The system's runlevel. */
92 #endif
93 #define BOOT_TIME 2 /* Time of system boot. */
94 #define NEW_TIME 3 /* Time after system clock changed. */
95 #define OLD_TIME 4 /* Time when system clock changed. */
97 #define INIT_PROCESS 5 /* Process spawned by the init process. */
98 #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
99 #define USER_PROCESS 7 /* Normal process. */
100 #define DEAD_PROCESS 8 /* Terminated process. */
102 #ifdef __USE_GNU
103 # define ACCOUNTING 9 /* System accounting. */
104 #endif