Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add man page for getlastlogx and friends.



details:   https://anonhg.NetBSD.org/src/rev/98ca3120b641
branches:  trunk
changeset: 550971:98ca3120b641
user:      wiz <wiz%NetBSD.org@localhost>
date:      Tue Aug 26 17:37:48 2003 +0000

description:
Add man page for getlastlogx and friends.

diffstat:

 distrib/sets/lists/comp/mi |   14 +++-
 lib/libc/gen/Makefile.inc  |    7 +-
 lib/libc/gen/getlastlogx.3 |  180 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 198 insertions(+), 3 deletions(-)

diffs (287 lines):

diff -r adee3b742208 -r 98ca3120b641 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Aug 26 17:35:28 2003 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Aug 26 17:37:48 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.607 2003/08/02 18:49:10 lukem Exp $
+#      $NetBSD: mi,v 1.608 2003/08/26 17:37:48 wiz Exp $
 ./usr/bin/addr2line            comp-debug-bin
 ./usr/bin/ar                   comp-util-bin
 ./usr/bin/as                   comp-util-bin
@@ -2227,6 +2227,7 @@
 ./usr/share/man/cat3/getifaddrs.0      comp-c-catman
 ./usr/share/man/cat3/getlabeloffset.0  comp-c-catman
 ./usr/share/man/cat3/getlabelsector.0  comp-c-catman
+./usr/share/man/cat3/getlastlogx.0     comp-c-catman
 ./usr/share/man/cat3/getloadavg.0      comp-c-catman
 ./usr/share/man/cat3/getmaxpartitions.0        comp-c-catman
 ./usr/share/man/cat3/getmaxx.0         comp-c-catman
@@ -2273,6 +2274,8 @@
 ./usr/share/man/cat3/gettmode.0                comp-c-catman
 ./usr/share/man/cat3/getttyent.0       comp-c-catman
 ./usr/share/man/cat3/getttynam.0       comp-c-catman
+./usr/share/man/cat3/getutmp.0 comp-c-catman
+./usr/share/man/cat3/getutmpx.0        comp-c-catman
 ./usr/share/man/cat3/getusershell.0    comp-c-catman
 ./usr/share/man/cat3/getutxent.0       comp-c-catman
 ./usr/share/man/cat3/getutxid.0        comp-c-catman
@@ -3463,12 +3466,15 @@
 ./usr/share/man/cat3/unsetenv.0        comp-c-catman
 ./usr/share/man/cat3/untouchwin.0              comp-c-catman
 ./usr/share/man/cat3/unvis.0   comp-c-catman
+./usr/share/man/cat3/updlastlogx.0     comp-c-catman
+./usr/share/man/cat3/updwtmpx.0        comp-c-catman
 ./usr/share/man/cat3/usbhid.0  comp-c-catman
 ./usr/share/man/cat3/use_default_colors.0              comp-c-catman
 ./usr/share/man/cat3/user_from_uid.0   comp-c-catman
 ./usr/share/man/cat3/usleep.0  comp-c-catman
 ./usr/share/man/cat3/util.0    comp-c-catman
 ./usr/share/man/cat3/utime.0   comp-c-catman
+./usr/share/man/cat3/utmpxname.0       comp-c-catman
 ./usr/share/man/cat3/va_arg.0  comp-c-catman
 ./usr/share/man/cat3/va_copy.0 comp-c-catman
 ./usr/share/man/cat3/va_end.0  comp-c-catman
@@ -5648,6 +5654,7 @@
 ./usr/share/man/man3/getifaddrs.3              comp-c-man
 ./usr/share/man/man3/getlabeloffset.3  comp-c-man
 ./usr/share/man/man3/getlabelsector.3  comp-c-man
+./usr/share/man/man3/getlastlogx.3     comp-c-man
 ./usr/share/man/man3/getloadavg.3              comp-c-man
 ./usr/share/man/man3/getmaxpartitions.3                comp-c-man
 ./usr/share/man/man3/getmaxx.3         comp-c-man
@@ -5694,6 +5701,8 @@
 ./usr/share/man/man3/gettmode.3                comp-c-man
 ./usr/share/man/man3/getttyent.3               comp-c-man
 ./usr/share/man/man3/getttynam.3               comp-c-man
+./usr/share/man/man3/getutmp.3         comp-c-man
+./usr/share/man/man3/getutmpx.3                comp-c-man
 ./usr/share/man/man3/getusershell.3            comp-c-man
 ./usr/share/man/man3/getutxent.3               comp-c-man
 ./usr/share/man/man3/getutxid.3                comp-c-man
@@ -6884,12 +6893,15 @@
 ./usr/share/man/man3/unsetenv.3                comp-c-man
 ./usr/share/man/man3/untouchwin.3              comp-c-man
 ./usr/share/man/man3/unvis.3           comp-c-man
+./usr/share/man/man3/updlastlogx.3             comp-c-man
+./usr/share/man/man3/updwtmpx.3                comp-c-man
 ./usr/share/man/man3/usbhid.3          comp-c-man
 ./usr/share/man/man3/use_default_colors.3              comp-c-man
 ./usr/share/man/man3/user_from_uid.3           comp-c-man
 ./usr/share/man/man3/usleep.3          comp-c-man
 ./usr/share/man/man3/util.3            comp-c-man
 ./usr/share/man/man3/utime.3           comp-c-man
+./usr/share/man/man3/utmpxname.3               comp-c-man
 ./usr/share/man/man3/va_arg.3          comp-c-man
 ./usr/share/man/man3/va_copy.3         comp-c-man
 ./usr/share/man/man3/va_end.3          comp-c-man
diff -r adee3b742208 -r 98ca3120b641 lib/libc/gen/Makefile.inc
--- a/lib/libc/gen/Makefile.inc Tue Aug 26 17:35:28 2003 +0000
+++ b/lib/libc/gen/Makefile.inc Tue Aug 26 17:37:48 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.121 2003/05/28 20:03:37 christos Exp $
+#      $NetBSD: Makefile.inc,v 1.122 2003/08/26 17:37:51 wiz Exp $
 #      from: @(#)Makefile.inc  8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -44,7 +44,7 @@
        endutxent.3 err.3 exec.3 fmtcheck.3 \
        fmtmsg.3 fnmatch.3 fpgetmask.3 frexp.3 ftok.3 fts.3 getbsize.3 \
        getcap.3 getcwd.3 getdomainname.3 getdiskbyname.3 getfsent.3 \
-       getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \
+       getgrent.3 getgrouplist.3 gethostname.3 getlastlogx.3 getloadavg.3 \
        getmntinfo.3 getnetgrent.3 getpagesize.3 getpass.3 \
        getprogname.3 getpwent.3 getttyent.3 getusershell.3 glob.3 \
        humanize_number.3 initgroups.3 isalnum.3 isalpha.3 isascii.3 \
@@ -88,6 +88,9 @@
 MLINKS+=getgrent.3 endgrent.3 getgrent.3 setgroupent.3 getgrent.3 getgrgid.3 \
        getgrent.3 getgrnam.3 getgrent.3 setgrent.3
 MLINKS+=gethostname.3 sethostname.3
+MLINKS+=getlastlogx.3 getutmp.3 getlastlogx.3 getutmpx.3
+MLINKS+=getlastlogx.3 updlastlogx.3 getlastlogx.3 updwtmpx.3
+MLINKS+=getlastlogx.3 utmpxname.3
 MLINKS+=getnetgrent.3 endnetgrent.3 getnetgrent.3 innetgr.3 \
        getnetgrent.3 setnetgrent.3
 MLINKS+=getprogname.3 setprogname.3
diff -r adee3b742208 -r 98ca3120b641 lib/libc/gen/getlastlogx.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/gen/getlastlogx.3        Tue Aug 26 17:37:48 2003 +0000
@@ -0,0 +1,180 @@
+.\"    $NetBSD: getlastlogx.3,v 1.1 2003/08/26 17:37:51 wiz Exp $
+.\"
+.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Thomas Klausner.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd August 26, 2003
+.Dt GETLASTLOGX 3
+.Os
+.Sh NAME
+.Nm getlastlogx ,
+.Nm getutmp ,
+.Nm getutmpx ,
+.Nm updlastlogx ,
+.Nm updwtmpx ,
+.Nm utmpxname
+.Nd user accounting database functions
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In utmpx.h
+.Ft struct lastlogx *
+.Fn getlastlogx "const char *fname" "uid_t uid" "struct lastlogx *ll"
+.Ft void
+.Fn getutmp "const struct utmpx *ux" "struct utmp *u"
+.Ft void
+.Fn getutmpx "const struct utmp *u" "struct utmpx *ux"
+.Ft int
+.Fn updlastlogx "const char *fname" "uid_t uid" "struct lastlogx *ll"
+.Ft int
+.Fn updwtmpx "const char *file" "const struct utmpx *utx"
+.Ft int
+.Fn utmpxname "const char *fname"
+.Sh DESCRIPTION
+The
+.Fn getlastlogx
+function looks up the entry for the user with user id
+.Fa uid
+in the
+.Xr lastlogx 5
+file given by
+.Fa fname
+and returns it in
+.Fa \&ll .
+If the provided
+.Fa \&ll
+is
+.Dv NULL ,
+the necessary space will be allocated by
+.Fn getlastlogx
+and should be
+.Fn free Ns d
+by the caller.
+.Pp
+The
+.Fn getutmp
+function fills out the entries in the struct utmp
+.Fa u
+with the data provided in the struct utmpx
+.Fa ux .
+.Fn getutmpx
+does the opposite, filling out the entries in the struct utmpx
+.Fa ux
+with the data provided in the struct utmp
+.Fa u ,
+and initializing all the unknown fields to 0.
+The sole exception is the
+.Fa ut_type
+field, which will be initialized to
+.Dv USER_PROCESS .
+.Pp
+The
+.Fn updlastlogx
+function tries to update the information for the user with the user id
+.Fa uid
+in the
+.Xr lastlogx 5
+file given by
+.Fa fname
+with the data supplied in
+.Fa \&ll .
+A
+.Ft struct lastlogx
+is defined like this:
+.Bd -literal
+struct lastlogx {
+        struct timeval ll_tv;           /* time entry was created */
+        char ll_line[_UTX_LINESIZE];    /* tty name */
+        char ll_host[_UTX_HOSTSIZE];    /* host name */
+        struct sockaddr_storage ll_ss;  /* address where entry was made from */
+};
+.Ed
+All the fields should be filled out by the caller.
+.Pp
+The
+.Fn updwtmpx
+function updates the
+.Xr wtmpx 5
+file
+.Fa file
+with the
+.Xr utmpx 5
+entry
+.Fa utx .
+.Pp
+The
+.Fn utmpxname
+function sets the default
+.Xr utmpx 5
+database file name to
+.Fa fname .
+.Sh RETURN VALUES
+.Fn getlastlogx
+returns the found entry on success, or
+.Dv NULL
+if it could not open the database, could not find an entry matching
+.Fa uid
+in there, or could not allocate the necessary space (in case
+.Fa \&ll
+was
+.Dv NULL ) .
+.Pp
+.Fn utmpxname
+returns 1 on success, or 0 if the supplied file name was too long or
+did not end with
+.Sq x .
+.Pp
+.Fn updlastlogx
+and
+.Fn updwtmpx
+return 0 on success, or \-1 in case the database or file respectively
+could not be opened or the data not written into it.
+.Sh SEE ALSO
+.Xr endutxent 3 ,
+.Xr loginx 3 ,
+.Xr utmpx 5
+.Sh HISTORY
+The functions
+.Fn getutmp ,
+.Fn getutmpx ,
+.Fn updwtmpx ,
+and
+.Fn utmpxname
+first appeared in
+.Tn Solaris .
+.Nm getlastlogx
+and
+.Nm updlastlogx
+first appeared in
+.Nx 2.0 .



Home | Main Index | Thread Index | Old Index