]> sourceware.org Git - glibc.git/blame - sysdeps/gnu/utmpbits.h
update from main archive 961116
[glibc.git] / sysdeps / gnu / utmpbits.h
CommitLineData
b8fe19fa
RM
1/* The `struct utmp' type, describing entries in the utmp file. GNU version.
2Copyright (C) 1993, 1996 Free Software Foundation, Inc.
3
4The GNU C Library is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public License as
6published by the Free Software Foundation; either version 2 of the
7License, or (at your option) any later version.
8
9The GNU C Library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
14You should have received a copy of the GNU Library General Public
15License along with the GNU C Library; see the file COPYING.LIB. If
16not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17Boston, MA 02111-1307, USA. */
18
19#ifndef _UTMPBITS_H
20
21#define _UTMPBITS_H 1
22#include <features.h>
23
24#include <sys/time.h>
25#include <sys/types.h>
26
27#define _PATH_UTMP "/var/run/utmp"
28#define _PATH_WTMP "/var/log/wtmp"
29#define _PATH_LASTLOG "/var/log/lastlog"
30
b8fe19fa
RM
31#define UT_UNKNOWN 0 /* for ut_type field */
32
33#define RUN_LVL 1
34#define BOOT_TIME 2
35#define NEW_TIME 3
36#define OLD_TIME 4
37
38#define INIT_PROCESS 5
39#define LOGIN_PROCESS 6
40#define USER_PROCESS 7
41#define DEAD_PROCESS 8
42
b8fe19fa
RM
43#define UT_LINESIZE 32
44#define UT_NAMESIZE 32
45#define UT_HOSTSIZE 256
46
47__BEGIN_DECLS
48
49struct lastlog
50{
51 time_t ll_time;
52 char ll_line[UT_LINESIZE];
53 char ll_host[UT_HOSTSIZE];
54};
55
56struct utmp
57{
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). */
4f54cdb1 63#define ut_name ut_user /* Compatible field name for same. */
b8fe19fa
RM
64 char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
65 int ut_exit; /* Process termination/exit status. */
b8fe19fa 66 long ut_session; /* Session ID, used for windowing. */
84724245 67 struct timeval ut_tv; /* Time entry was made. */
b8fe19fa
RM
68 int32_t ut_addr; /* Internet address of remote host. */
69 char pad[32]; /* Reserved for future use. */
70};
71
72#define ut_time ut_tv.tv_sec /* Backwards compatibility. */
73
e75154a6
RM
74/* Tell the user that we have a modern system with UT_HOST, UT_PID,
75 UT_TYPE, UT_ID and UT_TV fields. */
0200214b 76#define _HAVE_UT_TYPE 1
e75154a6 77#define _HAVE_UT_PID 1
0200214b
RM
78#define _HAVE_UT_ID 1
79#define _HAVE_UT_TV 1
4f54cdb1 80#define _HAVE_UT_HOST 1
0200214b 81
b8fe19fa
RM
82__END_DECLS
83
84#endif /* !_UTMP_H_ */
This page took 0.052798 seconds and 5 git commands to generate.