sessreg.h revision 1e5fa1c5
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/* Copyright 2005 Sun Microsystems, Inc. All rights reserved. 29 * 30 * Permission is hereby granted, free of charge, to any person obtaining a 31 * copy of this software and associated documentation files (the "Software"), 32 * to deal in the Software without restriction, including without limitation 33 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 34 * and/or sell copies of the Software, and to permit persons to whom the 35 * Software is furnished to do so, subject to the following conditions: 36 * 37 * The above copyright notice and this permission notice (including the next 38 * paragraph) shall be included in all copies or substantial portions of the 39 * Software. 40 * 41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 44 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 46 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 47 * DEALINGS IN THE SOFTWARE. 48 */ 49 50#include "config.h" 51 52#include <sys/types.h> 53#include <time.h> 54 55#ifdef HAVE_UTMP_H 56# include <utmp.h> 57# define USE_UTMP 58#endif 59 60#ifdef HAVE_UTMPX_H 61# include <utmpx.h> 62# define USE_UTMPX 63#endif 64 65#ifdef HAVE_SYS_PARAM_H 66# include <sys/param.h> 67#endif 68 69#ifndef HAVE_LASTLOG_H 70# define NO_LASTLOG 71#endif 72 73#ifndef NO_LASTLOG 74# ifdef CSRG_BASED 75# if (BSD < 199103) 76# include <lastlog.h> 77# endif 78# else 79# include <lastlog.h> 80# endif 81# include <pwd.h> 82#endif 83 84#ifdef CSRG_BASED 85#if !defined(__FreeBSD__) && !defined(__OpenBSD__) 86/* *BSD doesn't like a ':0' type entry in utmp */ 87#define NO_UTMP 88#endif 89#endif 90 91#ifndef WTMP_FILE 92# ifdef _PATH_WTMP 93# define WTMP_FILE _PATH_WTMP 94# else 95# define WTMP_FILE "/usr/adm/wtmp" 96# endif 97#endif 98#ifndef UTMP_FILE 99# ifdef _PATH_UTMP 100# define UTMP_FILE _PATH_UTMP 101# else 102# define UTMP_FILE "/etc/utmp" 103# endif 104#endif 105#ifndef NO_LASTLOG 106# ifndef LLOG_FILE 107# ifdef _PATH_LASTLOG 108# define LLOG_FILE _PATH_LASTLOG 109# else 110# define LLOG_FILE "/usr/adm/lastlog" 111# endif 112# endif 113#endif 114#ifndef SYSV 115# ifndef TTYS_FILE 116# define TTYS_FILE "/etc/ttys" 117# endif 118#endif 119 120