# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2012-05-01 04:39+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: TH
#: build/C/man3/getutent.3:30
#, no-wrap
msgid "GETUTENT"
msgstr ""

#. type: TH
#: build/C/man3/getutent.3:30
#, no-wrap
msgid "2008-06-29"
msgstr ""

#. type: TH
#: build/C/man3/getutent.3:30 build/C/man3/getutmp.3:24 build/C/man3/login.3:24 build/C/man3/updwtmp.3:23 build/C/man5/utmp.5:29
#, no-wrap
msgid "Linux Programmer's Manual"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:31 build/C/man3/getutmp.3:25 build/C/man3/login.3:25 build/C/man3/updwtmp.3:24 build/C/man5/utmp.5:30
#, no-wrap
msgid "NAME"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:34
msgid ""
"getutent, getutid, getutline, pututline, setutent, endutent, utmpname - "
"access utmp file entries"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:34 build/C/man3/getutmp.3:27 build/C/man3/login.3:27 build/C/man3/updwtmp.3:26 build/C/man5/utmp.5:32
#, no-wrap
msgid "SYNOPSIS"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:36 build/C/man3/login.3:29 build/C/man5/utmp.5:34
msgid "B<#include E<lt>utmp.hE<gt>>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:38
msgid "B<struct utmp *getutent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:40
msgid "B<struct utmp *getutid(struct utmp *>I<ut>B<);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:42
msgid "B<struct utmp *getutline(struct utmp *>I<ut>B<);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:44
msgid "B<struct utmp *pututline(struct utmp *>I<ut>B<);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:46
msgid "B<void setutent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:48
msgid "B<void endutent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:50
msgid "B<int utmpname(const char *>I<file>B<);>"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:50 build/C/man3/getutmp.3:35 build/C/man3/login.3:35 build/C/man3/updwtmp.3:35 build/C/man5/utmp.5:34
#, no-wrap
msgid "DESCRIPTION"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:53
msgid ""
"New applications should use the POSIX.1-specified \"utmpx\" versions of "
"these functions; see CONFORMING TO."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:62
msgid ""
"B<utmpname>()  sets the name of the utmp-format file for the other utmp "
"functions to access.  If B<utmpname>()  is not used to set the filename "
"before the other functions are used, they assume B<_PATH_UTMP>, as defined "
"in I<E<lt>paths.hE<gt>>."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:67
msgid ""
"B<setutent>()  rewinds the file pointer to the beginning of the utmp file.  "
"It is generally a good idea to call it before any of the other functions."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:72
msgid ""
"B<endutent>()  closes the utmp file.  It should be called when the user code "
"is done accessing the file with the other functions."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:79
msgid ""
"B<getutent>()  reads a line from the current file position in the utmp "
"file.  It returns a pointer to a structure containing the fields of the "
"line.  The definition of this structure is shown in B<utmp>(5)."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:95
msgid ""
"B<getutid>()  searches forward from the current file position in the utmp "
"file based upon I<ut>.  If I<ut-E<gt>ut_type> is one of B<RUN_LVL>, "
"B<BOOT_TIME>, B<NEW_TIME>, or B<OLD_TIME>, B<getutid>()  will find the first "
"entry whose I<ut_type> field matches I<ut-E<gt>ut_type>.  If "
"I<ut-E<gt>ut_type> is one of B<INIT_PROCESS>, B<LOGIN_PROCESS>, "
"B<USER_PROCESS>, or B<DEAD_PROCESS>, B<getutid>()  will find the first entry "
"whose I<ut_id> field matches I<ut-E<gt>ut_id>."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:105
msgid ""
"B<getutline>()  searches forward from the current file position in the utmp "
"file.  It scans entries whose I<ut_type> is B<USER_PROCESS> or "
"B<LOGIN_PROCESS> and returns the first one whose I<ut_line> field matches "
"I<ut-E<gt>ut_line>."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:117
msgid ""
"B<pututline>()  writes the I<utmp> structure I<ut> into the utmp file.  It "
"uses B<getutid>()  to search for the proper place in the file to insert the "
"new entry.  If it cannot find an appropriate slot for I<ut>, B<pututline>()  "
"will append the new entry to the end of the file."
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:117 build/C/man3/getutmp.3:49 build/C/man3/login.3:87
#, no-wrap
msgid "RETURN VALUE"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:126
msgid ""
"B<getutent>(), B<getutid>(), and B<getutline>()  return a pointer to a "
"I<struct utmp> on success, and NULL on failure (which includes the \"record "
"not found\" case).  This I<struct utmp> is allocated in static storage, and "
"may be overwritten by subsequent calls."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:132
msgid "On success B<pututline>()  returns I<ut>; on failure, it returns NULL."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:135
msgid ""
"B<utmpname>()  returns 0 if the new name was successfully stored, or -1 on "
"failure."
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:135
#, no-wrap
msgid "ERRORS"
msgstr ""

#. type: TP
#: build/C/man3/getutent.3:136
#, no-wrap
msgid "B<ENOMEM>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:139
msgid "Out of memory."
msgstr ""

#. type: TP
#: build/C/man3/getutent.3:139
#, no-wrap
msgid "B<ESRCH>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:142
msgid "Record not found."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:149
msgid ""
"B<setutent>(), B<pututline>(), and the B<getut* ()> functions can also fail "
"for the reasons described in B<open>(2)."
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:149 build/C/man3/login.3:92 build/C/man3/updwtmp.3:48 build/C/man5/utmp.5:223
#, no-wrap
msgid "FILES"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:151
msgid "/var/run/utmp\tdatabase of currently logged-in users"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:153
msgid "/var/log/wtmp\tdatabase of past user logins"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:153 build/C/man3/getutmp.3:53 build/C/man3/login.3:105 build/C/man3/updwtmp.3:52 build/C/man5/utmp.5:227
#, no-wrap
msgid "CONFORMING TO"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:155
msgid "XPG2, SVr4."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:165
msgid ""
"In XPG2 and SVID 2 the function B<pututline>()  is documented to return "
"void, and that is what it does on many systems (AIX, HP-UX, Linux libc5).  "
"HP-UX introduces a new function B<_pututline>()  with the prototype given "
"above for B<pututline>()  (also found in Linux libc5)."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:169
msgid ""
"All these functions are obsolete now on non-Linux systems.  POSIX.1-2001, "
"following SUSv1, does not have any of these functions, but instead uses"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:171
msgid "B<#include E<lt>utmpx.hE<gt>>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:173
msgid "B<struct utmpx *getutxent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:175
msgid "B<struct utmpx *getutxid(const struct utmpx *);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:177
msgid "B<struct utmpx *getutxline(const struct utmpx *);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:179
msgid "B<struct utmpx *pututxline(const struct utmpx *);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:181
msgid "B<void setutxent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:183
msgid "B<void endutxent(void);>"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:192
msgid ""
"These functions are provided by glibc, and perform the same task as their "
"equivalents without the \"x\", but use I<struct utmpx>, defined on Linux to "
"be the same as I<struct utmp>.  For completeness, glibc also provides "
"B<utmpxname>(), although this function is not specified by POSIX.1."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:200
msgid ""
"On some other systems, the I<utmpx> structure is a superset of the I<utmp> "
"structure, with additional fields, and larger versions of the existing "
"fields, and parallel files are maintained, often I</var/*/utmpx> and "
"I</var/*/wtmpx>."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:205
msgid ""
"Linux glibc on the other hand does not use a parallel I<utmpx> file since "
"its I<utmp> structure is already large enough.  The functions B<getutxent>()  "
"etc. are aliases for B<getutent>() etc."
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:205 build/C/man3/getutmp.3:56 build/C/man3/login.3:108 build/C/man3/updwtmp.3:65 build/C/man5/utmp.5:279
#, no-wrap
msgid "NOTES"
msgstr ""

#. type: SS
#: build/C/man3/getutent.3:206
#, no-wrap
msgid "Glibc Notes"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:209
msgid "The above functions are not thread-safe.  Glibc adds reentrant versions"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:214
#, no-wrap
msgid ""
"B<#define _GNU_SOURCE>    /* or _SVID_SOURCE or _BSD_SOURCE;\n"
"\\&                          see B<feature_test_macros(7)> */\n"
"B<#include E<lt>utmp.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:216
#, no-wrap
msgid "B<int getutent_r(struct utmp *>I<ubuf>B<, struct utmp **>I<ubufp>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:219
#, no-wrap
msgid ""
"B<int getutid_r(struct utmp *>I<ut>B<,>\n"
"B<              struct utmp *>I<ubuf>B<, struct utmp **>I<ubufp>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:222
#, no-wrap
msgid ""
"B<int getutline_r(struct utmp *>I<ut>B<,>\n"
"B<                struct utmp *>I<ubuf>B<, struct utmp **>I<ubufp>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:234
msgid ""
"These functions are GNU extensions, analogs of the functions of the same "
"name without the _r suffix.  The I<ubuf> argument gives these functions a "
"place to store their result.  On success they return 0, and a pointer to the "
"result is written in I<*ubufp>.  On error these functions return -1.  There "
"are no utmpx equivalents of the above functions.  (POSIX.1 does not specify "
"such functions.)"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:234
#, no-wrap
msgid "EXAMPLE"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:242
msgid ""
"The following example adds and removes a utmp record, assuming it is run "
"from within a pseudo terminal.  For usage in a real application, you should "
"check the return values of B<getpwuid>(3)  and B<ttyname>(3)."
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:249
#, no-wrap
msgid ""
"#include E<lt>string.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>pwd.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
"#include E<lt>utmp.hE<gt>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:254
#, no-wrap
msgid ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    struct utmp entry;\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:256
#, no-wrap
msgid "    system(\"echo before adding entry:;who\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:268
#, no-wrap
msgid ""
"    entry.ut_type = USER_PROCESS;\n"
"    entry.ut_pid = getpid();\n"
"    strcpy(entry.ut_line, ttyname(STDIN_FILENO) + strlen(\"/dev/\"));\n"
"    /* only correct for ptys named /dev/tty[pqr][0-9a-z] */\n"
"    strcpy(entry.ut_id, ttyname(STDIN_FILENO) + strlen(\"/dev/tty\"));\n"
"    time(&entry.ut_time);\n"
"    strcpy(entry.ut_user, getpwuid(getuid())-E<gt>pw_name);\n"
"    memset(entry.ut_host, 0, UT_HOSTSIZE);\n"
"    entry.ut_addr = 0;\n"
"    setutent();\n"
"    pututline(&entry);\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:270
#, no-wrap
msgid "    system(\"echo after adding entry:;who\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:277
#, no-wrap
msgid ""
"    entry.ut_type = DEAD_PROCESS;\n"
"    memset(entry.ut_line, 0, UT_LINESIZE);\n"
"    entry.ut_time = 0;\n"
"    memset(entry.ut_user, 0, UT_NAMESIZE);\n"
"    setutent();\n"
"    pututline(&entry);\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:279
#, no-wrap
msgid "    system(\"echo after removing entry:;who\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:283
#, no-wrap
msgid ""
"    endutent();\n"
"    exit(EXIT_SUCCESS);\n"
"}\n"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:284 build/C/man3/getutmp.3:67 build/C/man3/login.3:123 build/C/man3/updwtmp.3:81 build/C/man5/utmp.5:337
#, no-wrap
msgid "SEE ALSO"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:287
msgid "B<getutmp>(3), B<utmp>(5)"
msgstr ""

#. type: SH
#: build/C/man3/getutent.3:287 build/C/man3/getutmp.3:70 build/C/man3/login.3:126 build/C/man3/updwtmp.3:84 build/C/man5/utmp.5:350
#, no-wrap
msgid "COLOPHON"
msgstr ""

#. type: Plain text
#: build/C/man3/getutent.3:294 build/C/man3/getutmp.3:77 build/C/man3/login.3:133 build/C/man3/updwtmp.3:91 build/C/man5/utmp.5:357
msgid ""
"This page is part of release 3.40 of the Linux I<man-pages> project.  A "
"description of the project, and information about reporting bugs, can be "
"found at http://www.kernel.org/doc/man-pages/."
msgstr ""

#. type: TH
#: build/C/man3/getutmp.3:24
#, no-wrap
msgid "GETUTMP"
msgstr ""

#. type: TH
#: build/C/man3/getutmp.3:24
#, no-wrap
msgid "2010-09-10"
msgstr ""

#. type: TH
#: build/C/man3/getutmp.3:24 build/C/man5/utmp.5:29
#, no-wrap
msgid "Linux"
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:27
msgid "getutmp, getutmpx - copy utmp structure to utmpx, and vice versa"
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:31
#, no-wrap
msgid ""
"B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
"B<#include E<lt>utmpx.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:34
#, no-wrap
msgid ""
"B< void getutmp(const struct utmpx *>I<ux>B<, struct utmp *>I<u>B<);>\n"
"B< void getutmpx(const struct utmp *>I<u>B<, struct utmpx *>I<ux>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:49
msgid ""
"The B<getutmp>()  function copies the fields of the I<utmpx> structure "
"pointed to by I<ux> to the corresponding fields of the I<utmp> structure "
"pointed to by I<u>.  The B<getutmpx>()  function performs the converse "
"operation."
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:51
msgid "These functions do not return a value."
msgstr ""

#. type: SH
#: build/C/man3/getutmp.3:51
#, no-wrap
msgid "VERSIONS"
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:53
msgid "These functions first appeared in glibc in version 2.1.1."
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:56
msgid ""
"These functions are nonstandard, but appear on a few other systems, such as "
"Solaris and NetBSD."
msgstr ""

#.  e.g., on Solaris, the utmpx structure is rather larger than utmp.
#. type: Plain text
#: build/C/man3/getutmp.3:67
msgid ""
"These functions exist primarily for compatibility with other systems where "
"the I<utmp> and I<utmpx> structures contain different fields, or the size of "
"corresponding fields differs.  On Linux, the two structures contain the same "
"fields, and the fields have the same sizes."
msgstr ""

#. type: Plain text
#: build/C/man3/getutmp.3:70 build/C/man3/login.3:126
msgid "B<getutent>(3), B<utmp>(5)"
msgstr ""

#. type: TH
#: build/C/man3/login.3:24
#, no-wrap
msgid "LOGIN"
msgstr ""

#. type: TH
#: build/C/man3/login.3:24
#, no-wrap
msgid "2004-05-06"
msgstr ""

#. type: TH
#: build/C/man3/login.3:24 build/C/man3/updwtmp.3:23
#, no-wrap
msgid "GNU"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:27
msgid "login, logout - write utmp and wtmp entries"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:31
msgid "B<void login(const struct utmp *>I<ut>B<);>"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:33
msgid "B<int logout(const char *>I<ut_line>B<);>"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:35
msgid "Link with I<-lutil>."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:40
msgid ""
"The utmp file records who is currently using the system.  The wtmp file "
"records all logins and logouts.  See B<utmp>(5)."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:46
msgid ""
"The function B<login>()  takes the supplied I<struct utmp>, I<ut>, and "
"writes it to both the utmp and the wtmp file."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:50
msgid "The function B<logout>()  clears the entry in the utmp file again."
msgstr ""

#. type: SS
#: build/C/man3/login.3:50
#, no-wrap
msgid "GNU Details"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:71
msgid ""
"More precisely, B<login>()  takes the argument I<ut> struct, fills the field "
"I<ut-E<gt>ut_type> (if there is such a field) with the value "
"B<USER_PROCESS>, and fills the field I<ut-E<gt>ut_pid> (if there is such a "
"field) with the process ID of the calling process.  Then it tries to fill "
"the field I<ut-E<gt>ut_line>.  It takes the first of I<stdin>, I<stdout>, "
"I<stderr> that is a tty, and stores the corresponding pathname minus a "
"possible leading I</dev/> into this field, and then writes the struct to the "
"utmp file.  On the other hand, if no tty name was found, this field is "
"filled with \"???\" and the struct is not written to the utmp file.  After "
"this, the struct is written to the wtmp file."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:87
msgid ""
"The B<logout>()  function searches the utmp file for an entry matching the "
"I<ut_line> argument.  If a record is found, it is updated by zeroing out the "
"I<ut_name> and I<ut_host> fields, updating the I<ut_tv> timestamp field and "
"setting I<ut_type> (if there is such a field) to B<DEAD_PROCESS>."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:92
msgid ""
"The B<logout>()  function returns 1 if the entry was successfully written to "
"the database, or 0 if an error occurred."
msgstr ""

#. type: TP
#: build/C/man3/login.3:93
#, no-wrap
msgid "I</var/run/utmp>"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:99
msgid ""
"user accounting database, configured through B<_PATH_UTMP> in "
"I<E<lt>paths.hE<gt>>"
msgstr ""

#. type: TP
#: build/C/man3/login.3:99 build/C/man3/updwtmp.3:49
#, no-wrap
msgid "I</var/log/wtmp>"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:105
msgid ""
"user accounting log file, configured through B<_PATH_WTMP> in "
"I<E<lt>paths.hE<gt>>"
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:108
msgid "Not in POSIX.1-2001.  Present on the BSDs."
msgstr ""

#. type: Plain text
#: build/C/man3/login.3:123
msgid ""
"Note that the member I<ut_user> of I<struct utmp> is called I<ut_name> in "
"BSD.  Therefore, I<ut_name> is defined as an alias for I<ut_user> in "
"I<E<lt>utmp.hE<gt>>."
msgstr ""

#. type: TH
#: build/C/man3/updwtmp.3:23
#, no-wrap
msgid "UPDWTMP"
msgstr ""

#. type: TH
#: build/C/man3/updwtmp.3:23
#, no-wrap
msgid "2008-07-02"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:26
msgid "updwtmp, logwtmp - append an entry to the wtmp file"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:29
#, no-wrap
msgid "B<#include E<lt>utmp.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:31
#, no-wrap
msgid "B<void updwtmp(const char *>I<wtmp_file>B<, const struct utmp *>I<ut>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:34
#, no-wrap
msgid ""
"B<void logwtmp(const char *>I<line>B<, const char *>I<name>B<, const char "
"*>I<host>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:40
msgid "B<updwtmp>()  appends the utmp structure I<ut> to the wtmp file."
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:48
msgid ""
"B<logwtmp>()  constructs a utmp structure using I<line>, I<name>, I<host>, "
"current time and current process ID.  Then it calls B<updwtmp>()  to append "
"the structure to the wtmp file."
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:52
msgid "database of past user logins"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:55
msgid "Not in POSIX.1-2001.  Present on Solaris, NetBSD, and perhaps other systems."
msgstr ""

#. type: SH
#: build/C/man3/updwtmp.3:55
#, no-wrap
msgid "AVAILABILITY"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:65
msgid ""
"Both functions are available under glibc2, but not under libc5.  However, "
"B<logwtmp>()  used to occur in the old libbsd.  These days, the B<logwtmp>()  "
"function is included in libutil.  (Hence you'll need to add I<-lutil> to "
"your compiler command line to get it.)"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:69
msgid ""
"For consistency with the other \"utmpx\" functions (see B<getutxent>(3)), "
"glibc provides (since version 2.1):"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:72
#, no-wrap
msgid "B<#include E<lt>utmpx.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:74
#, no-wrap
msgid ""
"B<void updwtmpx (const char *>I<wtmpx_file>B<, const struct utmpx "
"*>I<utx>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:81
msgid ""
"This function performs the same task as B<updwtmp>(), but differs in that it "
"takes a I<utmpx> structure as its last argument."
msgstr ""

#. type: Plain text
#: build/C/man3/updwtmp.3:84
msgid "B<getutxent>(3), B<wtmp>(5)"
msgstr ""

#. type: TH
#: build/C/man5/utmp.5:29
#, no-wrap
msgid "UTMP"
msgstr ""

#. type: TH
#: build/C/man5/utmp.5:29
#, no-wrap
msgid "2011-09-28"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:32
msgid "utmp, wtmp - login records"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:41
msgid ""
"The I<utmp> file allows one to discover information about who is currently "
"using the system.  There may be more users currently using the system, "
"because not all programs use utmp logging."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:51
msgid ""
"B<Warning:> I<utmp> must not be writable by the user class \"other\", "
"because many system programs (foolishly)  depend on its integrity.  You risk "
"faked system logfiles and modifications of system files if you leave I<utmp> "
"writable to any user other than the owner and group owner of the file."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:59
msgid ""
"The file is a sequence of I<utmp> structures, declared as follows in "
"I<E<lt>utmp.hE<gt>> (note that this is only one of several definitions "
"around; details depend on the version of libc):"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:63
#, no-wrap
msgid "/* Values for ut_type field, below */\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:78
#, no-wrap
msgid ""
"#define EMPTY         0 /* Record does not contain valid info\n"
"                           (formerly known as UT_UNKNOWN on Linux) */\n"
"#define RUN_LVL       1 /* Change in system run-level (see\n"
"                           B<init>(8)) */\n"
"#define BOOT_TIME     2 /* Time of system boot (in I<ut_tv>) */\n"
"#define NEW_TIME      3 /* Time after system clock change\n"
"                           (in I<ut_tv>) */\n"
"#define OLD_TIME      4 /* Time before system clock change\n"
"                           (in I<ut_tv>) */\n"
"#define INIT_PROCESS  5 /* Process spawned by B<init>(8) */\n"
"#define LOGIN_PROCESS 6 /* Session leader process for user login */\n"
"#define USER_PROCESS  7 /* Normal process */\n"
"#define DEAD_PROCESS  8 /* Terminated process */\n"
"#define ACCOUNTING    9 /* Not implemented */\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:82
#, no-wrap
msgid ""
"#define UT_LINESIZE      32\n"
"#define UT_NAMESIZE      32\n"
"#define UT_HOSTSIZE     256\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:87
#, no-wrap
msgid ""
"struct exit_status {              /* Type for ut_exit, below */\n"
"    short int e_termination;      /* Process termination status */\n"
"    short int e_exit;             /* Process exit status */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:115
#, no-wrap
msgid ""
"struct utmp {\n"
"    short   ut_type;              /* Type of record */\n"
"    pid_t   ut_pid;               /* PID of login process */\n"
"    char    ut_line[UT_LINESIZE]; /* Device name of tty - \"/dev/\" */\n"
"    char    ut_id[4];             /* Terminal name suffix,\n"
"                                     or inittab(5) ID */\n"
"    char    ut_user[UT_NAMESIZE]; /* Username */\n"
"    char    ut_host[UT_HOSTSIZE]; /* Hostname for remote login, or\n"
"                                     kernel version for run-level\n"
"                                     messages */\n"
"    struct  exit_status ut_exit;  /* Exit status of a process\n"
"                                     marked as DEAD_PROCESS; not\n"
"                                     used by Linux init(8) */\n"
"    /* The ut_session and ut_tv fields must be the same size when\n"
"       compiled 32- and 64-bit.  This allows data files and shared\n"
"       memory to be shared between 32- and 64-bit applications. */\n"
"#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32\n"
"    int32_t ut_session;           /* Session ID (B<getsid>(2)),\n"
"                                     used for windowing */\n"
"    struct {\n"
"        int32_t tv_sec;           /* Seconds */\n"
"        int32_t tv_usec;          /* Microseconds */\n"
"    } ut_tv;                      /* Time entry was made */\n"
"#else\n"
"     long   ut_session;           /* Session ID */\n"
"     struct timeval ut_tv;        /* Time entry was made */\n"
"#endif\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:121
#, no-wrap
msgid ""
"    int32_t ut_addr_v6[4];        /* Internet address of remote\n"
"                                     host; IPv4 address uses\n"
"                                     just ut_addr_v6[0] */\n"
"    char __unused[20];            /* Reserved for future use */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:129
#, no-wrap
msgid ""
"/* Backward compatibility hacks */\n"
"#define ut_name ut_user\n"
"#ifndef _NO_UT_TIME\n"
"#define ut_time ut_tv.tv_sec\n"
"#endif\n"
"#define ut_xtime ut_tv.tv_sec\n"
"#define ut_addr ut_addr_v6[0]\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:139
msgid ""
"This structure gives the name of the special file associated with the user's "
"terminal, the user's login name, and the time of login in the form of "
"B<time>(2).  String fields are terminated by a null byte (\\(aq\\e0\\(aq)  "
"if they are shorter than the size of the field."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:156
msgid ""
"The first entries ever created result from B<init>(8)  processing "
"B<inittab>(5).  Before an entry is processed, though, B<init>(8)  cleans up "
"utmp by setting I<ut_type> to B<DEAD_PROCESS>, clearing I<ut_user>, "
"I<ut_host>, and I<ut_time> with null bytes for each record which I<ut_type> "
"is not B<DEAD_PROCESS> or B<RUN_LVL> and where no process with PID I<ut_pid> "
"exists.  If no empty record with the needed I<ut_id> can be found, "
"B<init>(8)  creates a new one.  It sets I<ut_id> from the inittab, I<ut_pid> "
"and I<ut_time> to the current values, and I<ut_type> to B<INIT_PROCESS>."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:175
msgid ""
"B<mingetty>(8)  (or B<agetty>(8))  locates the entry by the PID, changes "
"I<ut_type> to B<LOGIN_PROCESS>, changes I<ut_time>, sets I<ut_line>, and "
"waits for connection to be established.  B<login>(1), after a user has been "
"authenticated, changes I<ut_type> to B<USER_PROCESS>, changes I<ut_time>, "
"and sets I<ut_host> and I<ut_addr>.  Depending on B<mingetty>(8)  (or "
"B<agetty>(8))  and B<login>(1), records may be located by I<ut_line> instead "
"of the preferable I<ut_pid>."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:181
msgid ""
"When B<init>(8)  finds that a process has exited, it locates its utmp entry "
"by I<ut_pid>, sets I<ut_type> to B<DEAD_PROCESS>, and clears I<ut_user>, "
"I<ut_host> and I<ut_time> with null bytes."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:193
msgid ""
"B<xterm>(1)  and other terminal emulators directly create a B<USER_PROCESS> "
"record and generate the I<ut_id> by using the string that suffix part of the "
"terminal name (the characters following I</dev/[pt]ty>).  If they find a "
"B<DEAD_PROCESS> for this ID, they recycle it, otherwise they create a new "
"entry.  If they can, they will mark it as B<DEAD_PROCESS> on exiting and it "
"is advised that they null I<ut_line>, I<ut_time>, I<ut_user>, and I<ut_host> "
"as well."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:201
msgid ""
"B<telnetd>(8)  sets up a B<LOGIN_PROCESS> entry and leaves the rest to "
"B<login>(1)  as usual.  After the telnet session ends, B<telnetd>(8)  cleans "
"up utmp in the described way."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:223
msgid ""
"The I<wtmp> file records all logins and logouts.  Its format is exactly like "
"I<utmp> except that a null username indicates a logout on the associated "
"terminal.  Furthermore, the terminal name B<~> with username B<shutdown> or "
"B<reboot> indicates a system shutdown or reboot and the pair of terminal "
"names B<|>/B<}> logs the old/new system time when B<date>(1)  changes it.  "
"I<wtmp> is maintained by B<login>(1), B<init>(8), and some versions of "
"B<getty>(8)  (e.g., B<mingetty>(8)  or B<agetty>(8)).  None of these "
"programs creates the file, so if it is removed, record-keeping is turned "
"off."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:225
msgid "/var/run/utmp"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:227
msgid "/var/log/wtmp"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:246
msgid ""
"POSIX.1 does not specify a I<utmp> structure, but rather one named I<utmpx>, "
"with specifications for the fields I<ut_type>, I<ut_pid>, I<ut_line>, "
"I<ut_id>, I<ut_user>, and I<ut_tv>.  POSIX.1 does not specify the lengths of "
"the I<ut_line> and I<ut_user> fields."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:252
msgid ""
"Linux defines the I<utmpx> structure to be the same as the I<utmp> "
"structure."
msgstr ""

#. type: SS
#: build/C/man5/utmp.5:252
#, no-wrap
msgid "Comparison with Historical Systems"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:255
msgid ""
"Linux utmp entries conform neither to v7/BSD nor to System V; they are a mix "
"of the two."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:262
msgid ""
"v7/BSD has fewer fields; most importantly it lacks I<ut_type>, which causes "
"native v7/BSD-like programs to display (for example) dead or login entries.  "
"Further, there is no configuration file which allocates slots to sessions.  "
"BSD does so because it lacks I<ut_id> fields."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:274
msgid ""
"In Linux (as in System V), the I<ut_id> field of a record will never change "
"once it has been set, which reserves that slot without needing a "
"configuration file.  Clearing I<ut_id> may result in race conditions leading "
"to corrupted utmp entries and potential security holes.  Clearing the "
"abovementioned fields by filling them with null bytes is not required by "
"System V semantics, but makes it possible to run many programs which assume "
"BSD semantics and which do not modify utmp.  Linux uses the BSD conventions "
"for line contents, as documented above."
msgstr ""

#.  mtk: What is the referrent of "them" in the following sentence?
#.  System V only uses the type field to mark them and logs
#.  informative messages such as \fB"new time"\fP in the line field.
#. type: Plain text
#: build/C/man5/utmp.5:279
msgid "System V has no I<ut_host> or I<ut_addr_v6> fields."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:287
msgid ""
"Unlike various other systems, where utmp logging can be disabled by removing "
"the file, utmp must always exist on Linux.  If you want to disable B<who>(1)  "
"then do not make utmp world readable."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:290
msgid ""
"The file format is machine-dependent, so it is recommended that it be "
"processed only on the machine architecture where it was created."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:311
msgid ""
"Note that on I<biarch> platforms, that is, systems which can run both 32-bit "
"and 64-bit applications (x86-64, ppc64, s390x, etc.), I<ut_tv> is the same "
"size in 32-bit mode as in 64-bit mode.  The same goes for I<ut_session> and "
"I<ut_time> if they are present.  This allows data files and shared memory to "
"be shared between 32-bit and 64-bit applications.  This is achieved by "
"changing the type of I<ut_session> to I<int32_t>, and that of I<ut_tv> to a "
"struct with two I<int32_t> fields I<tv_sec> and I<tv_usec>.  Since I<ut_tv> "
"may not be the same as I<struct timeval>, then instead of the call:"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:315
#, no-wrap
msgid "gettimeofday((struct timeval *) &ut.ut_tv, NULL);\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:319
msgid "the following method of setting this field is recommended:"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:324
#, no-wrap
msgid ""
"struct utmp ut;\n"
"struct timeval tv;\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:328
#, no-wrap
msgid ""
"gettimeofday(&tv, NULL);\n"
"ut.ut_tv.tv_sec = tv.tv_sec;\n"
"ut.ut_tv.tv_usec = tv.tv_usec;\n"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:335
msgid ""
"Note that the I<utmp> struct from libc5 has changed in libc6.  Because of "
"this, binaries using the old libc5 struct will corrupt I</var/run/utmp> "
"and/or I</var/log/wtmp>."
msgstr ""

#. type: SH
#: build/C/man5/utmp.5:335
#, no-wrap
msgid "BUGS"
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:337
msgid "This man page is based on the libc5 one, things may work differently now."
msgstr ""

#. type: Plain text
#: build/C/man5/utmp.5:350
msgid ""
"B<ac>(1), B<date>(1), B<last>(1), B<login>(1), B<who>(1), B<getutent>(3), "
"B<getutmp>(3), B<login>(3), B<logout>(3), B<logwtmp>(3), B<updwtmp>(3), "
"B<init>(8)"
msgstr ""
