1 .\" This is free documentation; you can redistribute it and/or
2 .\" modify it under the terms of the GNU General Public License as
3 .\" published by the Free Software Foundation; either version 2 of
4 .\" the License, or (at your option) any later version.
6 .\" The GNU General Public License's references to "object code"
7 .\" and "executables" are to be interpreted as the output of any
8 .\" document formatting or typesetting system, including
9 .\" intermediate and printed output.
11 .\" This manual is distributed in the hope that it will be useful,
12 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
13 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 .\" GNU General Public License for more details.
16 .\" You should have received a copy of the GNU General Public
17 .\" License along with this manual; if not, write to the Free
18 .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
21 .\" Derived from text written by Martin Schulze (or taken from glibc.info)
22 .\" and text written by Paul Thompson - both copyright 2002.
24 .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO
25 .\" all rights reserved.
26 .\" Translated Thu Aug 26 06:04:53 JST 2004
27 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
28 .\" Updated & Modified Sat Jan 15 06:38:41 JST 2005 by Yuichi SATO
30 .TH LOGIN 3 2004-05-06 "GNU" "Linux Programmer's Manual"
33 .\"O login, logout \- write utmp and wtmp entries
34 login, logout \- utmp と wtmp エントリを書き込む
39 .BI "void login(const struct utmp *" ut );
41 .BI "int logout(const char *" ut_line );
43 .\"O Link with \fI\-lutil\fP.
47 .\"O The utmp file records who is currently using the system.
48 utmp ファイルは現在システムを使用しているユーザを記録する。
49 .\"O The wtmp file records all logins and logouts.
52 wtmp ファイルはすべてのログインとログアウトを記録する。
58 .\"O takes the supplied \fIstruct utmp\fP
60 .\"O and writes it to both the utmp and the wtmp file.
63 は与えられた \fIstruct utmp\fP
65 を utmp と wtmp ファイルの両方に書き込む。
69 .\"O clears the entry in the utmp file again.
72 は utmp ファイルにあるエントリをクリアする。
73 .\"O .SS "GNU Details"
77 .\"O takes the argument
79 .\"O struct, fills the field
81 .\"O (if there is such a field) with the value
82 .\"O .BR USER_PROCESS ,
83 .\"O and fills the field
85 .\"O (if there is such a field) with the process ID of the calling process.
90 構造体をとり、(もし存在するならば) フィールド
94 という値にし、(もし存在するならば) フィールド
96 を呼び出し元プロセスのプロセス ID の値にする。
97 .\"O Then it tries to fill the field
98 .\"O .IR ut\->ut_line .
102 .\"O It takes the first of \fIstdin\fP, \fIstdout\fP, \fIstderr\fP
103 .\"O that is a tty, and
104 .\"O stores the corresponding pathname minus a possible leading \fI/dev/\fP
105 .\"O into this field, and then writes the struct to the utmp file.
106 この関数は、標準入力・標準出力・標準エラー出力の中から
107 端末 (tty) である最初のものをとり、
108 対応するパス名から先頭の \fI/dev/\fP を引いたものを
109 このフィールドに格納して、この構造体を utmp ファイルに書き込む。
110 .\"O On the other hand, if no tty name was found, this field is filled with "???"
111 .\"O and the struct is not written to the utmp file.
112 .\"O After this, the struct is written to the wtmp file.
113 一方、端末名が見つからない場合は、このフィールドは "???" とされて、
114 この構造体は utmp ファイルに書き込まれない。
115 その後にこの構造体は wtmp ファイルに書き込まれる。
119 .\"O function searches the utmp file for an entry matching the
122 .\"O If a record is found, it is updated by zeroing out the
126 .\"O fields, updating the
128 .\"O timestamp field and setting
130 .\"O (if there is such a field) to
131 .\"O .BR DEAD_PROCESS .
148 .\"O .SH "RETURN VALUE"
152 .\"O function returns 1 if the entry was successfully written to the
153 .\"O database, or 0 if an error occurred.
154 エントリをデータベースに書き込むのに成功した場合、
162 .\"O user accounting database, configured through
173 .\"O user accounting log file, configured through
182 .\"O .SH "CONFORMING TO"
184 .\"O Not in POSIX.1-2001.
185 .\"O Present on the BSDs.
200 .\"O is defined as an alias for