#include <utmp.h> void updwtmp(const char *wtmp_path, const struct utmp *ut); void logwtmp(const char *line, const char *user, const char *host);
logwtmp() constructs a utmp structure using line, user, host, current time, and current process ID. Then it calls updwtmp() to append the structure to the wtmp file.
| インターフェース | 属性 | 値 |
| updwtmp(), logwtmp() | Thread safety | MT-Unsafe sig:ALRM timer |
#define _GNU_SOURCE /* See feature_test_macros(7) */ #include <utmpx.h> void updwtmpx (const char *wtmpx_path, const struct utmpx *utx);
この関数は updwtmp() と同じ作業を行うが、最後の引数として utmpx 構造体を取るところが異なる。