updwtmp

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

updwtmp, logwtmp - wtmp ファイルにエントリーを追加する  

ライブラリ

システムユーティリティライブラリ (libutil,~-lutil)  

書式

#include <utmp.h>

void updwtmp(const char *wtmp_path, const struct utmp *ut);
void logwtmp(const char *line, const char *user, const char *host);
 

説明

updwtmp() は、utmp 構造体 ut を wtmp ファイルに追加する。

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.  

ファイル

/var/log/wtmp
ユーザーログインの履歴データベース
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
updwtmp(), logwtmp() Thread safetyMT-Unsafe sig:ALRM timer
 

バージョン

For consistency with the other "utmpx" functions (see getutxent(3)), glibc provides (since glibc 2.1):

#define _GNU_SOURCE          /* See feature_test_macros(7) */
#include <utmpx.h>
void updwtmpx (const char *wtmpx_path, const struct utmpx *utx);

この関数は updwtmp() と同じ作業を行うが、最後の引数として utmpx 構造体を取るところが異なる。  

標準規格

なし。  

歴史

Solaris, NetBSD.  

関連項目

getutxent(3), wtmp(5)


 

Index

名前
ライブラリ
書式
説明
ファイル
属性
バージョン
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.