1.\" $NetBSD: loginx.3,v 1.2 2003/04/16 13:35:15 wiz Exp $ 2.\" 3.\" Copyright (c) 2002 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Thomas Klausner. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd September 26, 2002 31.Dt LOGINX 3 32.Os 33.Sh NAME 34.Nm loginx , 35.Nm logoutx , 36.Nm logwtmpx 37.Nd login utility functions 38.Sh LIBRARY 39.Lb libutil 40.Sh SYNOPSIS 41.In util.h 42.Ft void 43.Fn loginx "const struct utmpx *ut" 44.Ft int 45.Fn logoutx "const char *line" "int status" "int type" 46.Ft void 47.Fn logwtmpx "const char *line" "const char *name" "const char *host" "int status" "int type" 48.Sh DESCRIPTION 49The 50.Fn loginx , 51.Fn logoutx , 52and 53.Fn logwtmpx 54operate on the 55.Xr utmpx 5 56database of currently logged in users, and the 57.Xr wtmpx 5 58database of logins and logouts. 59.Pp 60The 61.Fn loginx 62function updates the 63.Pa /var/run/utmpx 64and 65.Pa /var/log/wtmpx 66databases with the information from 67.Fa ut . 68.Pp 69.Fn logoutx 70updates the entry corresponding to 71.Fa line 72with the type and status from 73.Fa type 74and 75.Fa status . 76.Pp 77.Fn logwtmpx 78writes an entry filled with data from 79.Fa line , 80.Fa name , 81.Fa host , 82.Fa status , 83and 84.Fa type 85to the 86.Xr wtmpx 5 87database. 88.Sh RETURN VALUES 89.Fn logoutx 90returns 1 on success, and 0 if no corresponding entry was found. 91.Sh SEE ALSO 92.Xr endutxent 3 , 93.Xr utmpx 5 94