1 --- endutxent.3.orig 2009-04-03 22:48:14.000000000 -0700
2 +++ endutxent.3 2009-04-04 18:16:44.000000000 -0700
4 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5 .\" POSSIBILITY OF SUCH DAMAGE.
7 -.Dd September 26, 2002
16 -.Fn getutxid "const struct utmpx *"
17 +.Fn getutxid "const struct utmpx *id"
19 -.Fn getutxline "const struct utmpx *"
20 +.Fn getutxline "const struct utmpx *line"
22 -.Fn pututxline "const struct utmpx *"
23 +.Fn pututxline "const struct utmpx *utx"
29 entry line to the accounting database, replacing a previous entry for
30 the same user if it exists.
31 +Only the superuser may write to the accounting database.
32 .Ss The utmpx structure
39 - char ut_name[_UTX_USERSIZE]; /* login name */
40 - char ut_id[_UTX_IDSIZE]; /* inittab id */
41 - char ut_line[_UTX_LINESIZE]; /* tty name */
42 - char ut_host[_UTX_HOSTSIZE]; /* host name */
43 - uint16_t ut_session; /* session id used for windowing */
44 - uint16_t ut_type; /* type of this entry */
45 - pid_t ut_pid; /* process id creating the entry */
47 - uint16_t e_termination; /* process termination signal */
48 - uint16_t e_exit; /* process exit status */
50 - struct sockaddr_storage ut_ss; /* address where entry was made from */
51 - struct timeval ut_tv; /* time entry was created */
52 - uint32_t ut_pad[10]; /* reserved for future use */
53 + char ut_user[_UTX_USERSIZE]; /* login name */
54 + char ut_id[_UTX_IDSIZE]; /* id */
55 + char ut_line[_UTX_LINESIZE]; /* tty name */
56 + pid_t ut_pid; /* process id creating the entry */
57 + short ut_type; /* type of this entry */
58 + struct timeval ut_tv; /* time entry was created */
59 + char ut_host[_UTX_HOSTSIZE]; /* host name */
60 + __uint32_t ut_pad[16]; /* reserved for future use */
67 -.Bl -tag -width LOGIN_PROCESSXX -compact -offset indent
68 +.Bl -tag -width ".Dv LOGIN_PROCESSXX" -compact -offset indent
70 Time of a system boot.
72 @@ -143,11 +138,115 @@
73 Time before system clock change.
76 -Provided for compatibility, not used on
78 +Provided for compatibility, not used.
82 +Time of system shutdown (extension to the standards).
87 +the other fields with meaningful values are as follows:
88 +.Bl -tag -width ".Dv LOGIN_PROCESSXX" -compact -offset indent
101 +.It Dv LOGIN_PROCESS
104 +(implementation-defined name of the login process),
116 +(login name of the user),
120 +(hostname of remote user)
122 +.It Dv SHUTDOWN_TIME
125 +.Ss Other extensions to the standards
128 +value may also be OR-ed with the following masks:
129 +.Bl -tag -width XXXX -compact -offset indent
130 +.It Dv UTMPX_AUTOFILL_MASK
131 +Depending on the main part of
133 +value, other fields are automatically filled in (as specified in the
134 +meaningful fields table above).
137 +field will be set using the convention of the last four characters of the
139 +field (itself filled in automatically from the tty name of the device connected
140 +to the standard input, output or error, whichever is available).
141 +Note that it is more efficient to fill in as many values as are already
142 +available beforehand, rather than have then automatically filled in.
143 +.It Dv UTMPX_DEAD_IF_CORRESPONDING_MASK
147 +.Dv DEAD_PROCESS, a call to
149 +will succeed only if a corresponding entry already exists with a
155 +Note that the above mask values do not show up in any file format, or in
156 +any subsequent reads of the data.
162 +equivalent capability,
164 +automatically writes to the appropriate files.
165 +Additional APIs to read these files is available in
166 +.Xr endutxent_wtmp 3
169 +.Ss Backward compatibility
172 +will automatically write equivalent entries into the
178 +Programs that read these old files should work as expected.
179 +However, directly writing to these files does not make corresponding
186 +equivalent files, so such write-access is deprecated.
189 returns the next entry, or
190 @@ -159,11 +258,45 @@
191 return the matching structure on success, or
193 if no match was found.
196 returns the structure that was successfully written, or
199 +is returned and the global variable
201 +is set to indicate the error.
203 +No errors are defined for the
214 +function may fail if:
217 +The process does not have appropriate privileges.
220 +.Dv UTMPX_DEAD_IF_CORRESPONDING_MASK
221 +flags was specified along with
223 +but no corresponding entry with
228 +Other errors may be returned if
229 +.Dv UTMPX_AUTOFILL_MASK
230 +was specified, and a field could not be auto-filled.
233 +.Xr endutxent_wtmp 3 ,