sessreg.h revision 61640528
1a6d9b409Smrg/*
2a6d9b409Smrg * Copyright 1990, 1998  The Open Group
3a6d9b409Smrg *
4a6d9b409Smrg * Permission to use, copy, modify, distribute, and sell this software and its
5a6d9b409Smrg * documentation for any purpose is hereby granted without fee, provided that
6a6d9b409Smrg * the above copyright notice appear in all copies and that both that
7a6d9b409Smrg * copyright notice and this permission notice appear in supporting
8a6d9b409Smrg * documentation.
961640528Smrg *
10a6d9b409Smrg * The above copyright notice and this permission notice shall be included
11a6d9b409Smrg * in all copies or substantial portions of the Software.
1261640528Smrg *
13a6d9b409Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14a6d9b409Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15a6d9b409Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16a6d9b409Smrg * IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17a6d9b409Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18a6d9b409Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19a6d9b409Smrg * OTHER DEALINGS IN THE SOFTWARE.
2061640528Smrg *
21a6d9b409Smrg * Except as contained in this notice, the name of The Open Group shall
22a6d9b409Smrg * not be used in advertising or otherwise to promote the sale, use or
23a6d9b409Smrg * other dealings in this Software without prior written authorization
24a6d9b409Smrg * from The Open Group.
25a6d9b409Smrg *
26a6d9b409Smrg */
27a6d9b409Smrg
2861640528Smrg/*
2961640528Smrg * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
30a6d9b409Smrg *
31a6d9b409Smrg * Permission is hereby granted, free of charge, to any person obtaining a
321e5fa1c5Smrg * copy of this software and associated documentation files (the "Software"),
331e5fa1c5Smrg * to deal in the Software without restriction, including without limitation
341e5fa1c5Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
351e5fa1c5Smrg * and/or sell copies of the Software, and to permit persons to whom the
361e5fa1c5Smrg * Software is furnished to do so, subject to the following conditions:
371e5fa1c5Smrg *
381e5fa1c5Smrg * The above copyright notice and this permission notice (including the next
391e5fa1c5Smrg * paragraph) shall be included in all copies or substantial portions of the
401e5fa1c5Smrg * Software.
411e5fa1c5Smrg *
421e5fa1c5Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
431e5fa1c5Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
441e5fa1c5Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
451e5fa1c5Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
461e5fa1c5Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
471e5fa1c5Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
481e5fa1c5Smrg * DEALINGS IN THE SOFTWARE.
49a6d9b409Smrg */
50a6d9b409Smrg
51a6d9b409Smrg#include "config.h"
52a6d9b409Smrg
53a6d9b409Smrg#include <sys/types.h>
54a6d9b409Smrg#include <time.h>
551e5fa1c5Smrg
561e5fa1c5Smrg#ifdef HAVE_UTMP_H
571e5fa1c5Smrg# include <utmp.h>
581e5fa1c5Smrg# define USE_UTMP
591e5fa1c5Smrg#endif
60a6d9b409Smrg
61a6d9b409Smrg#ifdef HAVE_UTMPX_H
621e5fa1c5Smrg# include <utmpx.h>
631e5fa1c5Smrg# define USE_UTMPX
64a6d9b409Smrg#endif
65a6d9b409Smrg
66a6d9b409Smrg#ifdef HAVE_SYS_PARAM_H
67a6d9b409Smrg# include <sys/param.h>
68a6d9b409Smrg#endif
69a6d9b409Smrg
7061640528Smrg#if defined(HAVE_STRUCT_LASTLOG) && defined(HAVE_PWD_H)
7161640528Smrg# ifdef HAVE_LASTLOG_H
7261640528Smrg#  include <lastlog.h>
73a6d9b409Smrg# endif
7461640528Smrg# include <pwd.h>
7561640528Smrg# define USE_LASTLOG
76a6d9b409Smrg#endif
77a6d9b409Smrg
78a6d9b409Smrg#ifndef WTMP_FILE
79a6d9b409Smrg# ifdef _PATH_WTMP
80a6d9b409Smrg#  define WTMP_FILE	_PATH_WTMP
81a6d9b409Smrg# else
82a6d9b409Smrg#  define WTMP_FILE	"/usr/adm/wtmp"
83a6d9b409Smrg# endif
84a6d9b409Smrg#endif
85a6d9b409Smrg#ifndef UTMP_FILE
86a6d9b409Smrg# ifdef _PATH_UTMP
87a6d9b409Smrg#  define UTMP_FILE	_PATH_UTMP
88a6d9b409Smrg# else
89a6d9b409Smrg#  define UTMP_FILE	"/etc/utmp"
90a6d9b409Smrg# endif
91a6d9b409Smrg#endif
9261640528Smrg#ifndef LLOG_FILE
9361640528Smrg# ifdef _PATH_LASTLOG
9461640528Smrg#  define LLOG_FILE	_PATH_LASTLOG
95e5adf029Smrg# else
9661640528Smrg#  define LLOG_FILE	"/usr/adm/lastlog"
97e5adf029Smrg# endif
98e5adf029Smrg#endif
9961640528Smrg#ifndef TTYS_FILE
10061640528Smrg# define TTYS_FILE	"/etc/ttys"
10161640528Smrg#endif
102e5adf029Smrg
10361640528Smrg#ifndef WTMPX_FILE
10461640528Smrg# define WTMPX_FILE	_PATH_WTMPX
105a6d9b409Smrg#endif
10661640528Smrg#ifndef UTMPX_FILE
10761640528Smrg# define UTMPX_FILE	_PATH_UTMPX
108a6d9b409Smrg#endif
109