Sat Jun 29 00:02:11 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
[glibc.git] / sysdeps / gnu / utmpbits.h
blob4749fdd3feb10cb798c583596a9822c803ff56a6
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 UT_UNKNOWN 0 /* for ut_type field */
33 #define RUN_LVL 1
34 #define BOOT_TIME 2
35 #define NEW_TIME 3
36 #define OLD_TIME 4
38 #define INIT_PROCESS 5
39 #define LOGIN_PROCESS 6
40 #define USER_PROCESS 7
41 #define DEAD_PROCESS 8
43 #define UT_LINESIZE 32
44 #define UT_NAMESIZE 32
45 #define UT_HOSTSIZE 256
47 __BEGIN_DECLS
49 struct lastlog
51 time_t ll_time;
52 char ll_line[UT_LINESIZE];
53 char ll_host[UT_HOSTSIZE];
56 struct utmp
58 short int ut_type; /* Type of login. */
59 pid_t ut_pid; /* Pid of login process. */
60 char ut_line[UT_LINESIZE]; /* NUL-terminated devicename of tty. */
61 char ut_id[4]; /* Inittab id. */
62 char ut_user[UT_NAMESIZE]; /* Username (not NUL terminated). */
63 #define ut_name ut_user /* Compatible field name for same. */
64 char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
65 int ut_exit; /* Process termination/exit status. */
66 long ut_session; /* Session ID, used for windowing. */
67 struct timeval ut_tv; /* Time entry was made. */
68 int32_t ut_addr; /* Internet address of remote host. */
69 char pad[32]; /* Reserved for future use. */
72 #define ut_time ut_tv.tv_sec /* Backwards compatibility. */
74 /* Tell the user that we have a modern system with UT_HOST, UT_TYPE, UT_ID
75 and UT_TV fields. */
76 #define _HAVE_UT_TYPE 1
77 #define _HAVE_UT_ID 1
78 #define _HAVE_UT_TV 1
79 #define _HAVE_UT_HOST 1
81 __END_DECLS
83 #endif /* !_UTMP_H_ */