OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / login.3
1 .\" Derived from text written by Martin Schulze (or taken from glibc.info)
2 .\" and text written by Paul Thompson - both copyright 2002.
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH LOGIN 3 2004\-05\-06 GNU "Linux Programmer's Manual"
31 .SH 名前
32 login, logout \- utmp と wtmp エントリを書き込む
33 .SH 書式
34 \fB#include <utmp.h>\fP
35 .sp
36 \fBvoid login(const struct utmp *\fP\fIut\fP\fB);\fP
37 .sp
38 \fBint logout(const char *\fP\fIut_line\fP\fB);\fP
39 .sp
40 \fI\-lutil\fP でリンクする。
41 .SH 説明
42 utmp ファイルは現在システムを使用しているユーザを記録する。 wtmp ファイルはすべてのログインとログアウトを記録する。 \fButmp\fP(5)
43 を参照すること。
44 .LP
45 関数 \fBlogin\fP()  は与えられた \fIstruct utmp\fP \fIut\fP を utmp と wtmp ファイルの両方に書き込む。
46 .LP
47 関数 \fBlogout\fP()  は utmp ファイルにあるエントリをクリアする。
48 .SS "GNU details"
49 More precisely, \fBlogin\fP()  takes the argument \fIut\fP struct, fills the field
50 \fIut\->ut_type\fP (if there is such a field) with the value
51 \fBUSER_PROCESS\fP, and fills the field \fIut\->ut_pid\fP (if there is such a
52 field) with the process ID of the calling process.  Then it tries to fill
53 the field \fIut\->ut_line\fP.  It takes the first of \fIstdin\fP, \fIstdout\fP,
54 \fIstderr\fP that is a terminal, and stores the corresponding pathname minus a
55 possible leading \fI/dev/\fP into this field, and then writes the struct to the
56 utmp file.  On the other hand, if no terminal name was found, this field is
57 filled with "???" and the struct is not written to the utmp file.  After
58 this, the struct is written to the wtmp file.
59 .LP
60 \fBlogout\fP()  関数は utmp ファイルから \fIut_line\fP 引き数にマッチするエントリを探す。 レコードが見つかった場合、
61 \fIut_name\fP と \fIut_host\fP フィールドをクリアして、 \fIut_tv\fP タイムスタンプフィールドを更新し、 (もし存在するならば)
62 \fIut_type\fP フィールドを \fBDEAD_PROCESS\fP に更新する。
63 .SH 返り値
64 エントリをデータベースに書き込むのに成功した場合、 \fBlogout\fP()  関数は 1 を返す。 またエラーが起こった場合、0 を返す。
65 .SH ファイル
66 .TP 
67 \fI/var/run/utmp\fP
68 ユーザアカウントデータベース。 \fI<paths.h>\fP における \fB_PATH_UTMP\fP で設定されている。
69 .TP 
70 \fI/var/log/wtmp\fP
71 ユーザアカウントログファイル。 \fI<paths.h>\fP における \fB_PATH_WTMP\fP で設定されている。
72 .SH 準拠
73 POSIX.1\-2001 にはない。 BSD 系に存在する。
74 .SH 注意
75 \fIstruct utmp\fP のメンバ \fIut_user\fP は、BSD では \fIut_name\fP という名前である点に注意すること。 そのため
76 \fIut_name\fP は \fI<utmp.h>\fP において \fIut_user\fP のエイリアスとして定義されている。
77 .SH 関連項目
78 \fBgetutent\fP(3), \fButmp\fP(5)
79 .SH この文書について
80 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
81 である。プロジェクトの説明とバグ報告に関する情報は
82 http://www.kernel.org/doc/man\-pages/ に書かれている。