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