updwtmpのヘルプ・マニュアル
日本語 英語
updwtmp --help
man updwtmp
UPDWTMP(3) Linux Programmer’s Manual UPDWTMP(3)
名前
updwtmp, logwtmp - wtmp ファイルにエントリを追加する
書式
#include
void updwtmp(const char *wtmp_file, const struct utmp *ut);
void logwtmp(const char *line, const char *name, const char *host);
説明
updwtmp() は、utmp 構造体 ut を wtmp ファイルに追加する。
logwtmp() は、 line, name, host, 現在時刻、現プロセスID から utmp 構造
体を作り、 updwtmp() を呼び出してその構造体をutmp ファイルに追加する。
ファイル
/var/log/wtmp
ユーザログインの履歴データベース
準拠
POSIX.1-2001 にはない。 Solaris, NetBSD に存在し、おそらく他のシステ ム
にもあるだろう。
利用可能な環境
glibc2 の下ではどちらの関数も利用可能である。 libc5 の下ではどちらも使
えないが、 logwtmp() は古い libbsd にあった。最近では、 logwtmp() 関 数
は libutil に含まれている (したがって、この関数を使うためにはコンパイラ
のコマンドラインに -lutil を追加する必要がある)。
注意
他の "utmpx" 関数群 (getutxent(3) 参照) との一貫性のために、glibc (バー
ジョン 2.1 以降) は以下の関数を提供している:
#include
void updwtmpx (const char *wtmpx_file, const struct utmpx *utx);
こ の関数は updwtmp() と同じ作業を行うが、最後の引き数として utmpx 構造
体を取るところが異なる。
関連項目
getutxent(3), wtmp(5)
GNU 2008-07-02 UPDWTMP(3)
UPDWTMP(3) Linux Programmer’s Manual UPDWTMP(3)
NAME
updwtmp, logwtmp - append an entry to the wtmp file
SYNOPSIS
#include
void updwtmp(const char *wtmp_file, const struct utmp *ut);
void logwtmp(const char *line, const char *name, const char *host);
DESCRIPTION
updwtmp() appends the utmp structure ut to the wtmp file.
logwtmp() constructs a utmp structure using line, name, host, current
time and current process ID. Then it calls updwtmp() to append the
structure to the utmp file.
FILES
/var/log/wtmp
database of past user logins
CONFORMING TO
Not in POSIX.1-2001. Present on Solaris, NetBSD, and perhaps other
systems.
AVAILABILITY
Both functions are available under glibc2, but not under libc5. How-
ever, logwtmp() used to occur in the old libbsd. These days, the
logwtmp() function is included in libutil. (Hence you’ll need to add
-lutil to your compiler command line to get it.)
NOTES
For consistency with the other "utmpx" functions (see getutxent(3)),
glibc provides (since version 2.1):
#include
void updwtmpx (const char *wtmpx_file, const struct utmpx *utx);
This function performs the same task as updwtmp(), but differs in that
it takes a utmpx structure as its last argument.
SEE ALSO
getutxent(3), wtmp(5)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-07-02 UPDWTMP(3)