Wed May 22 01:48:54 1996 Ulrich Drepper <drepper@cygnus.com>
[glibc.git] / sysdeps / gnu / utmpbits.h
blob8b939cee86cbab341cab0cb1569b2dec6532345c
1 /* The `struct utmp' type, describing entries in the utmp file. GNU version.
2 Copyright (C) 1993, 1996 Free Software Foundation, Inc.
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.
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.
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
16 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _UTMPBITS_H
21 #define _UTMPBITS_H 1
22 #include <features.h>
24 #include <sys/time.h>
25 #include <sys/types.h>
27 #define _PATH_UTMP "/var/run/utmp"
28 #define _PATH_WTMP "/var/log/wtmp"
29 #define _PATH_LASTLOG "/var/log/lastlog"
31 #define UTMP_FILE _PATH_UTMP
32 #define WTMP_FILE _PATH_WTMP
33 #define UTMP_FILENAME UTMP_FILE
34 #define WTMP_FILENAME WTMP_FILE
36 #define UT_UNKNOWN 0 /* for ut_type field */
38 #define RUN_LVL 1
39 #define BOOT_TIME 2
40 #define NEW_TIME 3
41 #define OLD_TIME 4
43 #define INIT_PROCESS 5
44 #define LOGIN_PROCESS 6
45 #define USER_PROCESS 7
46 #define DEAD_PROCESS 8
48 #define ut_name ut_user
50 #define UT_LINESIZE 32
51 #define UT_NAMESIZE 32
52 #define UT_HOSTSIZE 256
54 __BEGIN_DECLS
56 struct lastlog
58 time_t ll_time;
59 char ll_line[UT_LINESIZE];
60 char ll_host[UT_HOSTSIZE];
63 struct utmp
65 short int ut_type; /* Type of login. */
66 pid_t ut_pid; /* Pid of login process. */
67 char ut_line[UT_LINESIZE]; /* NUL-terminated devicename of tty. */
68 char ut_id[4]; /* Inittab id. */
69 char ut_user[UT_NAMESIZE]; /* Username (not NUL terminated). */
70 char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
71 int ut_exit; /* Process termination/exit status. */
72 struct timeval ut_tv; /* Time entry was made. */
73 long ut_session; /* Session ID, used for windowing. */
74 int32_t ut_addr; /* Internet address of remote host. */
75 char pad[32]; /* Reserved for future use. */
78 #define ut_time ut_tv.tv_sec /* Backwards compatibility. */
80 __END_DECLS
82 #endif /* !_UTMP_H_ */