xref: /dflybsd-src/lib/libutil/loginx.c (revision e72784e37e16f29ab242cac813ebe302de425930)
1*59a92d18SAlex Hornung /*	$NetBSD: loginx.c,v 1.2 2003/08/07 16:44:59 agc Exp $	*/
2*59a92d18SAlex Hornung 
3*59a92d18SAlex Hornung /*
4*59a92d18SAlex Hornung  * Copyright (c) 1988, 1993
5*59a92d18SAlex Hornung  *	The Regents of the University of California.  All rights reserved.
6*59a92d18SAlex Hornung  *
7*59a92d18SAlex Hornung  * Redistribution and use in source and binary forms, with or without
8*59a92d18SAlex Hornung  * modification, are permitted provided that the following conditions
9*59a92d18SAlex Hornung  * are met:
10*59a92d18SAlex Hornung  * 1. Redistributions of source code must retain the above copyright
11*59a92d18SAlex Hornung  *    notice, this list of conditions and the following disclaimer.
12*59a92d18SAlex Hornung  * 2. Redistributions in binary form must reproduce the above copyright
13*59a92d18SAlex Hornung  *    notice, this list of conditions and the following disclaimer in the
14*59a92d18SAlex Hornung  *    documentation and/or other materials provided with the distribution.
15*59a92d18SAlex Hornung  * 3. Neither the name of the University nor the names of its contributors
16*59a92d18SAlex Hornung  *    may be used to endorse or promote products derived from this software
17*59a92d18SAlex Hornung  *    without specific prior written permission.
18*59a92d18SAlex Hornung  *
19*59a92d18SAlex Hornung  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20*59a92d18SAlex Hornung  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*59a92d18SAlex Hornung  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*59a92d18SAlex Hornung  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23*59a92d18SAlex Hornung  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*59a92d18SAlex Hornung  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25*59a92d18SAlex Hornung  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26*59a92d18SAlex Hornung  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27*59a92d18SAlex Hornung  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28*59a92d18SAlex Hornung  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29*59a92d18SAlex Hornung  * SUCH DAMAGE.
30*59a92d18SAlex Hornung  */
31*59a92d18SAlex Hornung 
32*59a92d18SAlex Hornung #include <sys/cdefs.h>
33*59a92d18SAlex Hornung 
34*59a92d18SAlex Hornung #include <sys/types.h>
35*59a92d18SAlex Hornung 
36*59a92d18SAlex Hornung #include <assert.h>
37*59a92d18SAlex Hornung #include <errno.h>
38*59a92d18SAlex Hornung #include <fcntl.h>
39*59a92d18SAlex Hornung #include <stdio.h>
40*59a92d18SAlex Hornung #include <stdlib.h>
41*59a92d18SAlex Hornung #include <unistd.h>
42*59a92d18SAlex Hornung #include <libutil.h>
43*59a92d18SAlex Hornung #include <utmpx.h>
44*59a92d18SAlex Hornung 
45*59a92d18SAlex Hornung void
loginx(const struct utmpx * ut)46*59a92d18SAlex Hornung loginx(const struct utmpx *ut)
47*59a92d18SAlex Hornung {
48*59a92d18SAlex Hornung 	(void)pututxline(ut);
49*59a92d18SAlex Hornung 	(void)updwtmpx(_PATH_WTMPX, ut);
50*59a92d18SAlex Hornung }
51