xref: /netbsd-src/lib/libutil/loginx.3 (revision 11a6dbe72840351315e0652b2fc6663628c84cad)
1*11a6dbe7Smartin.\"	$NetBSD: loginx.3,v 1.3 2008/04/30 13:10:52 martin Exp $
24a47c952Swiz.\"
34a47c952Swiz.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
44a47c952Swiz.\" All rights reserved.
54a47c952Swiz.\"
64a47c952Swiz.\" This code is derived from software contributed to The NetBSD Foundation
74a47c952Swiz.\" by Thomas Klausner.
84a47c952Swiz.\"
94a47c952Swiz.\" Redistribution and use in source and binary forms, with or without
104a47c952Swiz.\" modification, are permitted provided that the following conditions
114a47c952Swiz.\" are met:
124a47c952Swiz.\" 1. Redistributions of source code must retain the above copyright
134a47c952Swiz.\"    notice, this list of conditions and the following disclaimer.
144a47c952Swiz.\" 2. Redistributions in binary form must reproduce the above copyright
154a47c952Swiz.\"    notice, this list of conditions and the following disclaimer in the
164a47c952Swiz.\"    documentation and/or other materials provided with the distribution.
174a47c952Swiz.\"
184a47c952Swiz.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
194a47c952Swiz.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
204a47c952Swiz.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
214a47c952Swiz.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
224a47c952Swiz.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
234a47c952Swiz.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
244a47c952Swiz.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
254a47c952Swiz.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
264a47c952Swiz.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
274a47c952Swiz.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
284a47c952Swiz.\" POSSIBILITY OF SUCH DAMAGE.
294a47c952Swiz.\"
304a47c952Swiz.Dd September 26, 2002
314a47c952Swiz.Dt LOGINX 3
324a47c952Swiz.Os
334a47c952Swiz.Sh NAME
344a47c952Swiz.Nm loginx ,
354a47c952Swiz.Nm logoutx ,
364a47c952Swiz.Nm logwtmpx
374a47c952Swiz.Nd login utility functions
384a47c952Swiz.Sh LIBRARY
394a47c952Swiz.Lb libutil
404a47c952Swiz.Sh SYNOPSIS
41472351e1Swiz.In util.h
424a47c952Swiz.Ft void
434a47c952Swiz.Fn loginx "const struct utmpx *ut"
444a47c952Swiz.Ft int
454a47c952Swiz.Fn logoutx "const char *line" "int status" "int type"
464a47c952Swiz.Ft void
474a47c952Swiz.Fn logwtmpx "const char *line" "const char *name" "const char *host" "int status" "int type"
484a47c952Swiz.Sh DESCRIPTION
494a47c952SwizThe
504a47c952Swiz.Fn loginx ,
514a47c952Swiz.Fn logoutx ,
524a47c952Swizand
534a47c952Swiz.Fn logwtmpx
544a47c952Swizoperate on the
554a47c952Swiz.Xr utmpx 5
564a47c952Swizdatabase of currently logged in users, and the
574a47c952Swiz.Xr wtmpx 5
584a47c952Swizdatabase of logins and logouts.
594a47c952Swiz.Pp
604a47c952SwizThe
614a47c952Swiz.Fn loginx
624a47c952Swizfunction updates the
634a47c952Swiz.Pa /var/run/utmpx
644a47c952Swizand
654a47c952Swiz.Pa /var/log/wtmpx
664a47c952Swizdatabases with the information from
674a47c952Swiz.Fa ut .
684a47c952Swiz.Pp
694a47c952Swiz.Fn logoutx
704a47c952Swizupdates the entry corresponding to
714a47c952Swiz.Fa line
724a47c952Swizwith the type and status from
734a47c952Swiz.Fa type
744a47c952Swizand
754a47c952Swiz.Fa status .
764a47c952Swiz.Pp
774a47c952Swiz.Fn logwtmpx
784a47c952Swizwrites an entry filled with data from
794a47c952Swiz.Fa line ,
804a47c952Swiz.Fa name ,
814a47c952Swiz.Fa host ,
824a47c952Swiz.Fa status ,
834a47c952Swizand
844a47c952Swiz.Fa type
854a47c952Swizto the
864a47c952Swiz.Xr wtmpx 5
874a47c952Swizdatabase.
884a47c952Swiz.Sh RETURN VALUES
894a47c952Swiz.Fn logoutx
904a47c952Swizreturns 1 on success, and 0 if no corresponding entry was found.
914a47c952Swiz.Sh SEE ALSO
924a47c952Swiz.Xr endutxent 3 ,
934a47c952Swiz.Xr utmpx 5
94