sessreg.h revision 61640528
1/*
2 * Copyright 1990, 1998  The Open Group
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation.
9 *
10 * The above copyright notice and this permission notice shall be included
11 * in all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 * IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 * OTHER DEALINGS IN THE SOFTWARE.
20 *
21 * Except as contained in this notice, the name of The Open Group shall
22 * not be used in advertising or otherwise to promote the sale, use or
23 * other dealings in this Software without prior written authorization
24 * from The Open Group.
25 *
26 */
27
28/*
29 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
30 *
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
37 *
38 * The above copyright notice and this permission notice (including the next
39 * paragraph) shall be included in all copies or substantial portions of the
40 * Software.
41 *
42 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
45 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
47 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
48 * DEALINGS IN THE SOFTWARE.
49 */
50
51#include "config.h"
52
53#include <sys/types.h>
54#include <time.h>
55
56#ifdef HAVE_UTMP_H
57# include <utmp.h>
58# define USE_UTMP
59#endif
60
61#ifdef HAVE_UTMPX_H
62# include <utmpx.h>
63# define USE_UTMPX
64#endif
65
66#ifdef HAVE_SYS_PARAM_H
67# include <sys/param.h>
68#endif
69
70#if defined(HAVE_STRUCT_LASTLOG) && defined(HAVE_PWD_H)
71# ifdef HAVE_LASTLOG_H
72#  include <lastlog.h>
73# endif
74# include <pwd.h>
75# define USE_LASTLOG
76#endif
77
78#ifndef WTMP_FILE
79# ifdef _PATH_WTMP
80#  define WTMP_FILE	_PATH_WTMP
81# else
82#  define WTMP_FILE	"/usr/adm/wtmp"
83# endif
84#endif
85#ifndef UTMP_FILE
86# ifdef _PATH_UTMP
87#  define UTMP_FILE	_PATH_UTMP
88# else
89#  define UTMP_FILE	"/etc/utmp"
90# endif
91#endif
92#ifndef LLOG_FILE
93# ifdef _PATH_LASTLOG
94#  define LLOG_FILE	_PATH_LASTLOG
95# else
96#  define LLOG_FILE	"/usr/adm/lastlog"
97# endif
98#endif
99#ifndef TTYS_FILE
100# define TTYS_FILE	"/etc/ttys"
101#endif
102
103#ifndef WTMPX_FILE
104# define WTMPX_FILE	_PATH_WTMPX
105#endif
106#ifndef UTMPX_FILE
107# define UTMPX_FILE	_PATH_UTMPX
108#endif
109