xref: /netbsd-src/include/utmp.h (revision e7633a342635fbfbc28a664ce963ee3f58471d7f)
1*e7633a34Sdholland /*	$NetBSD: utmp.h,v 1.13 2016/01/22 23:59:44 dholland Exp $	*/
24d2cbfceScgd 
3e6b5ddd9Scgd /*
4e6b5ddd9Scgd  * Copyright (c) 1988, 1993
5e6b5ddd9Scgd  *	The Regents of the University of California.  All rights reserved.
6e6b5ddd9Scgd  * (c) UNIX System Laboratories, Inc.
7e6b5ddd9Scgd  * All or some portions of this file are derived from material licensed
8e6b5ddd9Scgd  * to the University of California by American Telephone and Telegraph
9e6b5ddd9Scgd  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10e6b5ddd9Scgd  * the permission of UNIX System Laboratories, Inc.
11e6b5ddd9Scgd  *
12e6b5ddd9Scgd  * Redistribution and use in source and binary forms, with or without
13e6b5ddd9Scgd  * modification, are permitted provided that the following conditions
14e6b5ddd9Scgd  * are met:
15e6b5ddd9Scgd  * 1. Redistributions of source code must retain the above copyright
16e6b5ddd9Scgd  *    notice, this list of conditions and the following disclaimer.
17e6b5ddd9Scgd  * 2. Redistributions in binary form must reproduce the above copyright
18e6b5ddd9Scgd  *    notice, this list of conditions and the following disclaimer in the
19e6b5ddd9Scgd  *    documentation and/or other materials provided with the distribution.
20039cc956Sagc  * 3. Neither the name of the University nor the names of its contributors
21e6b5ddd9Scgd  *    may be used to endorse or promote products derived from this software
22e6b5ddd9Scgd  *    without specific prior written permission.
23e6b5ddd9Scgd  *
24e6b5ddd9Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25e6b5ddd9Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26e6b5ddd9Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27e6b5ddd9Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28e6b5ddd9Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29e6b5ddd9Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30e6b5ddd9Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31e6b5ddd9Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32e6b5ddd9Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33e6b5ddd9Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34e6b5ddd9Scgd  * SUCH DAMAGE.
35e6b5ddd9Scgd  *
364d2cbfceScgd  *	@(#)utmp.h	8.2 (Berkeley) 1/21/94
37e6b5ddd9Scgd  */
38e6b5ddd9Scgd 
39e6b5ddd9Scgd #ifndef	_UTMP_H_
40e6b5ddd9Scgd #define	_UTMP_H_
41e6b5ddd9Scgd 
42*e7633a34Sdholland #include <sys/cdefs.h>
43*e7633a34Sdholland #include <time.h> /* for time_t */
44*e7633a34Sdholland 
45e6b5ddd9Scgd #define	_PATH_UTMP	"/var/run/utmp"
46e6b5ddd9Scgd #define	_PATH_WTMP	"/var/log/wtmp"
47e6b5ddd9Scgd #define	_PATH_LASTLOG	"/var/log/lastlog"
48e6b5ddd9Scgd 
49e6b5ddd9Scgd #define	UT_NAMESIZE	8
50e6b5ddd9Scgd #define	UT_LINESIZE	8
51e6b5ddd9Scgd #define	UT_HOSTSIZE	16
52e6b5ddd9Scgd 
53e6b5ddd9Scgd struct lastlog {
54e6b5ddd9Scgd 	time_t	ll_time;
55e6b5ddd9Scgd 	char	ll_line[UT_LINESIZE];
56e6b5ddd9Scgd 	char	ll_host[UT_HOSTSIZE];
57e6b5ddd9Scgd };
58e6b5ddd9Scgd 
59e6b5ddd9Scgd struct utmp {
60e6b5ddd9Scgd 	char	ut_line[UT_LINESIZE];
61e6b5ddd9Scgd 	char	ut_name[UT_NAMESIZE];
62e6b5ddd9Scgd 	char	ut_host[UT_HOSTSIZE];
6386569ff2Scgd 	time_t	ut_time;
64e6b5ddd9Scgd };
65e6b5ddd9Scgd 
662004baccSchristos __BEGIN_DECLS
6719b7469aSperry int utmpname(const char *);
6819b7469aSperry void setutent(void);
6950728e78Schristos #ifndef __LIBC12_SOURCE__
7050728e78Schristos struct utmp *getutent(void) __RENAME(__getutent50);
7150728e78Schristos #endif
7219b7469aSperry void endutent(void);
732004baccSchristos __END_DECLS
742004baccSchristos 
75e6b5ddd9Scgd #endif /* !_UTMP_H_ */
76