#include <utmp.h>
struct utmp *getutent(void);
struct utmp
{
short int ut_type; //登录类型
pid_t ut_pid; //login 进程的pid
char ut_line[UT_LINESIZE]; //登录装置名, 省略了"/dev/"
char ut_id[4]; //Inittab ID
char ut_user[UT_NAMESIZE]; //登录账号
char ut_host[UT_HOSTSIZE]; //登录账号的远程主机名称
struxt exit_status ut_exit; //当类型为DEAD_PROCESS 时进程的结束状态
long int ut_session; //Sessioc ID
struct timeval ut_tv; //时间记录
int32_t ut_addr_v6[4]; //远程主机的网络地址
char __unused[20]; //保留未使用
};
struct exit_status
{
short int e_termination; //进程结束状态
short int e_exit; //进程退出状态
};
#include <utmp.h>
main()
{
struct utmp *u;
while((u = getutent()))
{
if(u->ut_type == USER_PROCESS)
printf("%d %s %s %s \n", u->ut_type, u->ut_user, u->ut_line, u->ut_host);
}
endutent();
}
#include <utmp.h>
void setutent(void);
#include <utmp.h>
void endutent(void);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有