Sun Jul 5 01:09:48 2020 UTC ()
revert previous; utmpxname is already documented in getlastlogx.3. Should
probably be moved.


(christos)
diff -r1.204 -r1.205 src/lib/libc/gen/Makefile.inc
diff -r1.6 -r1.7 src/lib/libc/gen/endutxent.3

cvs diff -r1.204 -r1.205 src/lib/libc/gen/Makefile.inc (expand / switch to unified diff)

--- src/lib/libc/gen/Makefile.inc 2020/07/05 01:05:50 1.204
+++ src/lib/libc/gen/Makefile.inc 2020/07/05 01:09:48 1.205
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile.inc,v 1.204 2020/07/05 01:05:50 christos Exp $ 1# $NetBSD: Makefile.inc,v 1.205 2020/07/05 01:09:48 christos Exp $
2# from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 2# from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95
3 3
4# gen sources 4# gen sources
5.PATH: ${ARCHDIR}/gen ${.CURDIR}/gen 5.PATH: ${ARCHDIR}/gen ${.CURDIR}/gen
6 6
7.if ${RUMPRUN} != "yes" 7.if ${RUMPRUN} != "yes"
8SRCS+= _errno.c daemon.c 8SRCS+= _errno.c daemon.c
9.endif 9.endif
10 10
11SRCS+= alarm.c alphasort.c arc4random.c assert.c asysctl.c \ 11SRCS+= alarm.c alphasort.c arc4random.c assert.c asysctl.c \
12 basename.c clock.c closedir.c closefrom.c \ 12 basename.c clock.c closedir.c closefrom.c \
13 confstr.c ctermid.c ctype_.c \ 13 confstr.c ctermid.c ctype_.c \
14 dehumanize_number.c devname.c dirname.c disklabel.c err.c errx.c \ 14 dehumanize_number.c devname.c dirname.c disklabel.c err.c errx.c \
@@ -87,27 +87,27 @@ MAN+= alarm.3 arc4random.3 basename.3 bs @@ -87,27 +87,27 @@ MAN+= alarm.3 arc4random.3 basename.3 bs
87 wordexp.3 87 wordexp.3
88 88
89MLINKS+=bswap.3 bswap16.3 bswap.3 bswap32.3 bswap.3 bswap64.3 89MLINKS+=bswap.3 bswap16.3 bswap.3 bswap32.3 bswap.3 bswap64.3
90MLINKS+=cpuset.3 cpuset_create.3 cpuset.3 cpuset_destroy.3 \ 90MLINKS+=cpuset.3 cpuset_create.3 cpuset.3 cpuset_destroy.3 \
91 cpuset.3 cpuset_zero.3 cpuset.3 cpuset_set.3 cpuset.3 cpuset_clr.3 \ 91 cpuset.3 cpuset_zero.3 cpuset.3 cpuset_set.3 cpuset.3 cpuset_clr.3 \
92 cpuset.3 cpuset_isset.3 cpuset.3 cpuset_size.3 92 cpuset.3 cpuset_isset.3 cpuset.3 cpuset_size.3
93MLINKS+=devname.3 devname_r.3 93MLINKS+=devname.3 devname_r.3
94MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ 94MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \
95 directory.3 readdir.3 directory.3 readdir_r.3 directory.3 \ 95 directory.3 readdir.3 directory.3 readdir_r.3 directory.3 \
96 rewinddir.3 directory.3 seekdir.3 directory.3 telldir.3 \ 96 rewinddir.3 directory.3 seekdir.3 directory.3 telldir.3 \
97 directory.3 fdopendir.3  97 directory.3 fdopendir.3
98MLINKS+=endutxent.3 getutxent.3 endutxent.3 getutxid.3 \ 98MLINKS+=endutxent.3 getutxent.3 endutxent.3 getutxid.3 \
99 endutxent.3 getutxline.3 endutxent.3 pututxline.3 \ 99 endutxent.3 getutxline.3 endutxent.3 pututxline.3 \
100 endutxent.3 setutxent.3 endutmpx.3 utmpxname.3 100 endutxent.3 setutxent.3
101MLINKS+=err.3 verr.3 err.3 errx.3 err.3 verrx.3 err.3 warn.3 err.3 vwarn.3 \ 101MLINKS+=err.3 verr.3 err.3 errx.3 err.3 verrx.3 err.3 warn.3 err.3 vwarn.3 \
102 err.3 warnx.3 err.3 vwarnx.3 err.3 errc.3 err.3 verrc.3 err.3 warnc.3 \ 102 err.3 warnx.3 err.3 vwarnx.3 err.3 errc.3 err.3 verrc.3 err.3 warnc.3 \
103 err.3 vwarnc.3 103 err.3 vwarnc.3
104MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 execlpe.3 \ 104MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 execlpe.3 \
105 exec.3 execv.3 exec.3 execvp.3 exec.3 execvpe.3 exec.3 exect.3  105 exec.3 execv.3 exec.3 execvp.3 exec.3 execvpe.3 exec.3 exect.3
106MLINKS+=extattr_namespace_to_string.3 extattr_string_to_namespace.3 \ 106MLINKS+=extattr_namespace_to_string.3 extattr_string_to_namespace.3 \
107 extattr_copy_file.3 extattr_copy_fd.3 \ 107 extattr_copy_file.3 extattr_copy_fd.3 \
108 extattr_copy_file.3 extattr_copy_link.3 \ 108 extattr_copy_file.3 extattr_copy_link.3 \
109 extattr_copy_file.3 cpxattr.3 \ 109 extattr_copy_file.3 cpxattr.3 \
110 extattr_copy_file.3 fcpxattr.3 \ 110 extattr_copy_file.3 fcpxattr.3 \
111 extattr_copy_file.3 lcpxattr.3 111 extattr_copy_file.3 lcpxattr.3
112MLINKS+=fpgetmask.3 fpgetround.3 fpgetmask.3 fpgetsticky.3 \ 112MLINKS+=fpgetmask.3 fpgetround.3 fpgetmask.3 fpgetsticky.3 \
113 fpgetmask.3 fpsetmask.3 fpgetmask.3 fpsetround.3 \ 113 fpgetmask.3 fpsetmask.3 fpgetmask.3 fpsetround.3 \

cvs diff -r1.6 -r1.7 src/lib/libc/gen/endutxent.3 (expand / switch to unified diff)

--- src/lib/libc/gen/endutxent.3 2020/07/05 01:05:50 1.6
+++ src/lib/libc/gen/endutxent.3 2020/07/05 01:09:48 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: endutxent.3,v 1.6 2020/07/05 01:05:50 christos Exp $ 1.\" $NetBSD: endutxent.3,v 1.7 2020/07/05 01:09:48 christos Exp $
2.\" 2.\"
3.\" Copyright (c) 2002 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Thomas Klausner. 7.\" by Thomas Klausner.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -17,56 +17,53 @@ @@ -17,56 +17,53 @@
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 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 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 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 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 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd July 4, 2020 30.Dd September 26, 2002
31.Dt ENDUTXENT 3 31.Dt ENDUTXENT 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm endutxent , 34.Nm endutxent ,
35.Nm getutxent , 35.Nm getutxent ,
36.Nm getutxid , 36.Nm getutxid ,
37.Nm getutxline , 37.Nm getutxline ,
38.Nm pututxline , 38.Nm pututxline ,
39.Nm setutxent , 39.Nm setutxent
40.Nm utxname 
41.Nd user accounting database functions 40.Nd user accounting database functions
42.Sh LIBRARY 41.Sh LIBRARY
43.Lb libc 42.Lb libc
44.Sh SYNOPSIS 43.Sh SYNOPSIS
45.In utmpx.h 44.In utmpx.h
46.Ft void 45.Ft void
47.Fn endutxent void 46.Fn endutxent void
48.Ft struct utmpx * 47.Ft struct utmpx *
49.Fn getutxent void 48.Fn getutxent void
50.Ft struct utmpx * 49.Ft struct utmpx *
51.Fn getutxid "const struct utmpx *ut" 50.Fn getutxid "const struct utmpx *"
52.Ft struct utmpx * 51.Ft struct utmpx *
53.Fn getutxline "const struct utmpx *ut" 52.Fn getutxline "const struct utmpx *"
54.Ft struct utmpx * 53.Ft struct utmpx *
55.Fn pututxline "const struct utmpx *ut" 54.Fn pututxline "const struct utmpx *"
56.Ft void 55.Ft void
57.Fn setutxent void 56.Fn setutxent void
58.Ft void 
59.Fn utmpxname "const char *fname" 
60.Sh DESCRIPTION 57.Sh DESCRIPTION
61These functions provide access to the 58These functions provide access to the
62.Xr utmpx 5 59.Xr utmpx 5
63user accounting database. 60user accounting database.
64.Pp 61.Pp
65.Fn getutxent 62.Fn getutxent
66reads the next entry from the database; 63reads the next entry from the database;
67if the database was not yet open, it also opens it. 64if the database was not yet open, it also opens it.
68.Fn setutxent 65.Fn setutxent
69resets the database, so that the next 66resets the database, so that the next
70.Fn getutxent 67.Fn getutxent
71call will get the first entry. 68call will get the first entry.
72.Fn endutxent 69.Fn endutxent
@@ -84,30 +81,26 @@ returns the next @@ -84,30 +81,26 @@ returns the next
84or 81or
85.Dv USER_PROCESS 82.Dv USER_PROCESS
86entry which has the same name as specified in the 83entry which has the same name as specified in the
87.Va ut_line 84.Va ut_line
88field, or 85field, or
89.Dv NULL 86.Dv NULL
90if no match is found. 87if no match is found.
91.Pp 88.Pp
92.Fn pututxline 89.Fn pututxline
93adds the argument 90adds the argument
94.Xr utmpx 5 91.Xr utmpx 5
95entry line to the accounting database, replacing a previous entry for 92entry line to the accounting database, replacing a previous entry for
96the same user if it exists. 93the same user if it exists.
97.Pp 
98.Fn utmpxname 
99set sets the database file to 
100.Fa fname . 
101.Ss The utmpx structure 94.Ss The utmpx structure
102The 95The
103.Nm utmpx 96.Nm utmpx
104structure has the following definition: 97structure has the following definition:
105.Pp 98.Pp
106.Bd -literal 99.Bd -literal
107struct utmpx { 100struct utmpx {
108 char ut_name[_UTX_USERSIZE]; /* login name */ 101 char ut_name[_UTX_USERSIZE]; /* login name */
109 char ut_id[_UTX_IDSIZE]; /* inittab id */ 102 char ut_id[_UTX_IDSIZE]; /* inittab id */
110 char ut_line[_UTX_LINESIZE]; /* tty name */ 103 char ut_line[_UTX_LINESIZE]; /* tty name */
111 char ut_host[_UTX_HOSTSIZE]; /* host name */ 104 char ut_host[_UTX_HOSTSIZE]; /* host name */
112 uint16_t ut_session; /* session id used for windowing */ 105 uint16_t ut_session; /* session id used for windowing */
113 uint16_t ut_type; /* type of this entry */ 106 uint16_t ut_type; /* type of this entry */
@@ -152,52 +145,41 @@ A user process. @@ -152,52 +145,41 @@ A user process.
152.Fn getutxent 145.Fn getutxent
153returns the next entry, or 146returns the next entry, or
154.Dv NULL 147.Dv NULL
155on failure (end of database or problems reading from the database). 148on failure (end of database or problems reading from the database).
156.Fn getutxid 149.Fn getutxid
157and 150and
158.Fn getutxline 151.Fn getutxline
159return the matching structure on success, or 152return the matching structure on success, or
160.Dv NULL 153.Dv NULL
161if no match was found. 154if no match was found.
162.Fn pututxline 155.Fn pututxline
163returns the structure that was successfully written, or 156returns the structure that was successfully written, or
164.Dv NULL . 157.Dv NULL .
165.Fn utmpxname 
166returns 
167.Dv 1 
168on success and 
169.Dv 0 
170on failure. 
171.Sh SEE ALSO 158.Sh SEE ALSO
172.Xr logwtmpx 3 , 159.Xr logwtmpx 3 ,
173.Xr utmpx 5 160.Xr utmpx 5
174.Sh STANDARDS 161.Sh STANDARDS
175The 162The
176.Fn endutxent , 163.Fn endutxent ,
177.Fn getutxent , 164.Fn getutxent ,
178.Fn getutxid , 165.Fn getutxid ,
179.Fn getutxline , 166.Fn getutxline ,
180.Fn pututxline , 167.Fn pututxline ,
181.Fn setutxent 168.Fn setutxent
182functions all conform to 169all conform to
183.St -p1003.1-2001 170.St -p1003.1-2001
184(XSI extension), and previously to 171(XSI extension), and previously to
185.St -xpg4.2 . 172.St -xpg4.2 .
186The 
187.Fn utxname  
188functions is a 
189.Nx 
190externsion. 
191The fields 173The fields
192.Fa ut_user , 174.Fa ut_user ,
193.Fa ut_id , 175.Fa ut_id ,
194.Fa ut_line , 176.Fa ut_line ,
195.Fa ut_pid , 177.Fa ut_pid ,
196.Fa ut_type , 178.Fa ut_type ,
197and 179and
198.Fa ut_tv 180.Fa ut_tv
199conform to 181conform to
200.St -p1003.1-2001 182.St -p1003.1-2001
201(XSI extension), and previously to 183(XSI extension), and previously to
202.St -xpg4.2 . 184.St -xpg4.2 .
203.\" .Fa ut_host , 185.\" .Fa ut_host ,