| @@ -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 |
61 | These functions provide access to the | | 58 | These functions provide access to the |
62 | .Xr utmpx 5 | | 59 | .Xr utmpx 5 |
63 | user accounting database. | | 60 | user accounting database. |
64 | .Pp | | 61 | .Pp |
65 | .Fn getutxent | | 62 | .Fn getutxent |
66 | reads the next entry from the database; | | 63 | reads the next entry from the database; |
67 | if the database was not yet open, it also opens it. | | 64 | if the database was not yet open, it also opens it. |
68 | .Fn setutxent | | 65 | .Fn setutxent |
69 | resets the database, so that the next | | 66 | resets the database, so that the next |
70 | .Fn getutxent | | 67 | .Fn getutxent |
71 | call will get the first entry. | | 68 | call 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 |
84 | or | | 81 | or |
85 | .Dv USER_PROCESS | | 82 | .Dv USER_PROCESS |
86 | entry which has the same name as specified in the | | 83 | entry which has the same name as specified in the |
87 | .Va ut_line | | 84 | .Va ut_line |
88 | field, or | | 85 | field, or |
89 | .Dv NULL | | 86 | .Dv NULL |
90 | if no match is found. | | 87 | if no match is found. |
91 | .Pp | | 88 | .Pp |
92 | .Fn pututxline | | 89 | .Fn pututxline |
93 | adds the argument | | 90 | adds the argument |
94 | .Xr utmpx 5 | | 91 | .Xr utmpx 5 |
95 | entry line to the accounting database, replacing a previous entry for | | 92 | entry line to the accounting database, replacing a previous entry for |
96 | the same user if it exists. | | 93 | the same user if it exists. |
97 | .Pp | | | |
98 | .Fn utmpxname | | | |
99 | set sets the database file to | | | |
100 | .Fa fname . | | | |
101 | .Ss The utmpx structure | | 94 | .Ss The utmpx structure |
102 | The | | 95 | The |
103 | .Nm utmpx | | 96 | .Nm utmpx |
104 | structure has the following definition: | | 97 | structure has the following definition: |
105 | .Pp | | 98 | .Pp |
106 | .Bd -literal | | 99 | .Bd -literal |
107 | struct utmpx { | | 100 | struct 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 |
153 | returns the next entry, or | | 146 | returns the next entry, or |
154 | .Dv NULL | | 147 | .Dv NULL |
155 | on failure (end of database or problems reading from the database). | | 148 | on failure (end of database or problems reading from the database). |
156 | .Fn getutxid | | 149 | .Fn getutxid |
157 | and | | 150 | and |
158 | .Fn getutxline | | 151 | .Fn getutxline |
159 | return the matching structure on success, or | | 152 | return the matching structure on success, or |
160 | .Dv NULL | | 153 | .Dv NULL |
161 | if no match was found. | | 154 | if no match was found. |
162 | .Fn pututxline | | 155 | .Fn pututxline |
163 | returns the structure that was successfully written, or | | 156 | returns the structure that was successfully written, or |
164 | .Dv NULL . | | 157 | .Dv NULL . |
165 | .Fn utmpxname | | | |
166 | returns | | | |
167 | .Dv 1 | | | |
168 | on success and | | | |
169 | .Dv 0 | | | |
170 | on 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 |
175 | The | | 162 | The |
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 |
182 | functions all conform to | | 169 | all 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 . |
186 | The | | | |
187 | .Fn utxname | | | |
188 | functions is a | | | |
189 | .Nx | | | |
190 | externsion. | | | |
191 | The fields | | 173 | The 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 , |
197 | and | | 179 | and |
198 | .Fa ut_tv | | 180 | .Fa ut_tv |
199 | conform to | | 181 | conform 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 , |