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