xref: /netbsd-src/lib/libutil/loginx.c (revision eb7c1594f145c931049e1fd9eb056a5987e87e59)
1*eb7c1594Sagc /*	$NetBSD: loginx.c,v 1.2 2003/08/07 16:44:59 agc Exp $	*/
2961e3a84Sjdolecek 
3961e3a84Sjdolecek /*
4961e3a84Sjdolecek  * Copyright (c) 1988, 1993
5961e3a84Sjdolecek  *	The Regents of the University of California.  All rights reserved.
6961e3a84Sjdolecek  *
7961e3a84Sjdolecek  * Redistribution and use in source and binary forms, with or without
8961e3a84Sjdolecek  * modification, are permitted provided that the following conditions
9961e3a84Sjdolecek  * are met:
10961e3a84Sjdolecek  * 1. Redistributions of source code must retain the above copyright
11961e3a84Sjdolecek  *    notice, this list of conditions and the following disclaimer.
12961e3a84Sjdolecek  * 2. Redistributions in binary form must reproduce the above copyright
13961e3a84Sjdolecek  *    notice, this list of conditions and the following disclaimer in the
14961e3a84Sjdolecek  *    documentation and/or other materials provided with the distribution.
15*eb7c1594Sagc  * 3. Neither the name of the University nor the names of its contributors
16961e3a84Sjdolecek  *    may be used to endorse or promote products derived from this software
17961e3a84Sjdolecek  *    without specific prior written permission.
18961e3a84Sjdolecek  *
19961e3a84Sjdolecek  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20961e3a84Sjdolecek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21961e3a84Sjdolecek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22961e3a84Sjdolecek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23961e3a84Sjdolecek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24961e3a84Sjdolecek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25961e3a84Sjdolecek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26961e3a84Sjdolecek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27961e3a84Sjdolecek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28961e3a84Sjdolecek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29961e3a84Sjdolecek  * SUCH DAMAGE.
30961e3a84Sjdolecek  */
31961e3a84Sjdolecek 
32961e3a84Sjdolecek #include <sys/cdefs.h>
33961e3a84Sjdolecek #if defined(LIBC_SCCS) && !defined(lint)
34*eb7c1594Sagc __RCSID("$NetBSD: loginx.c,v 1.2 2003/08/07 16:44:59 agc Exp $");
35961e3a84Sjdolecek #endif /* LIBC_SCCS and not lint */
36961e3a84Sjdolecek 
37961e3a84Sjdolecek #include <sys/types.h>
38961e3a84Sjdolecek 
39961e3a84Sjdolecek #include <assert.h>
40961e3a84Sjdolecek #include <errno.h>
41961e3a84Sjdolecek #include <fcntl.h>
42961e3a84Sjdolecek #include <stdio.h>
43961e3a84Sjdolecek #include <stdlib.h>
44961e3a84Sjdolecek #include <unistd.h>
45961e3a84Sjdolecek #include <util.h>
46961e3a84Sjdolecek #include <utmp.h>
47961e3a84Sjdolecek #include <utmpx.h>
48961e3a84Sjdolecek 
49961e3a84Sjdolecek void
loginx(const struct utmpx * ut)50961e3a84Sjdolecek loginx(const struct utmpx *ut)
51961e3a84Sjdolecek {
52961e3a84Sjdolecek 	(void)pututxline(ut);
53961e3a84Sjdolecek 	(void)updwtmpx(_PATH_WTMPX, ut);
54961e3a84Sjdolecek }
55