|
îáú÷áîéå
wtmp - ÆopÍaÔÙ utmp É wtmp.
óéîôáëóéó
#include <sys/types.h> #include <utmp.h>
ïðéóáîéå
æaÊÌÙ, ËoÔopÙe coÄepÖaÔ ÉÎÆopÍaÃÉÀ o×ÌaÄeÌØÃe, ÔeËyÝaÑ
ÉÎÆopÍaÃÉÑ ÄÌÑ ÔaËÉx ËoÍaÎÄ, ËaË who(1), write(1) É
login(1), ÉcÐoÌØÚyÀÔ cÔpyËÔypy, oÐÉcaÎÎyÀ × utmp.h:
#define UTMP_FILE "/etc/utmp" #define WTMP_FILE "/etc/wtmp" #define ut_name ut_user struct utmp{ char ut_user[8]; /* ÉÍÑ ÐoÌØÚo×aÔeÌÑ*/ char ut_id[4]; /* oÂÙÞÎo cÔpoËa #*/ char ut_line[12]; /* yÍÑ ycÔpoÊcÔ×a (ËoÎcoÌØ, ÐpÉÎÔep lnxx*/ short ut_pid; /* ÎoÍep ÐpoÃecca*/ short ut_type; /* ÔÉÐ ×xoÄa*/ struct exit_status{ short e_termination; /* cÔaÔyc Úa×epÛeÎÉÑ ÐpoÃecca*/ short e_exit; /* cÔaÔyc Úa×epÛeÎÉÑ ÐpoÃecca*/ } time_t ut_time; /* ×peÍÑ ×xoÄa*/ }; #define EMPTY 0 #define RUN_LVL 1 #define BOOT_TIME 2 #define OLD_TIME 3 #define NEW_TIME 4 #define INIT_PROCESS 5 /* ÐpoÃecc ÐopoÖÄeÎ ÐpoÃeÄypoÊ "init"*/ #define LOGIN_PROCESS 6 /* ÐpoÃecc "getty" oÖÉÄaeÔ ÉÍÑ */ #define USER_PROCESS 7 /* ÐoÌØÚo×aÔeÌØcËÉÊ ÐpoÃecc*/ #define DEAD_PROCESS 8 #define ACCOUNING 9 #define UTMAXTYPE ACCOUNTING /* ÎaÉÂoÌØÛaÑ ×oÚÍoÖÎaÑ ×eÌÉÞÉÎa ut_type*/ /* CÐeÃÉaÌØÎÙe cÔpoËÉ ÆopÍaÔo×, ÉcÐoÌØÚyeÍÙe × ÐoÌe "ut_line", */ /* ËoÇÄa ÔeËyÝÉÍ Ñ×ÌÑeÔcÑ ÎeËoÔopÙÊ ÄpyÇoÊ ÐpoÃecc. */ /* CÔpoËa ÄÌÑ ÐoÌÑ "ut_line" Îe ÍoÖeÔ ÂÙÔØ ÂoÌee 11 cÉÍ×oÌo× */ /* + ÎyÌe×oÊ cÉÍ×oÌ ËaË ÐpÉÚÎaË ËoÎÃa ÆaÊÌa */
æáêìù
/usr/include/utmp.h /etc/utmp /etc/wtmp
óí. ôáëöå
getut(2), login(1), who(1), write(1)
|