⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 who3top.c

📁 unix linux 编程实践源代码
💻 C
字号:
/* who3.c - who with buffered reads *	  - surpresses empty records *	  - formats time nicely *	  - buffers input (using utmplib) */#include	<stdio.h>#include	<sys/types.h>#include	<utmp.h>#include	<fcntl.h>#include	<time.h>#define	SHOWHOSTvoid show_info(struct utmp *);void showtime(time_t);int main(){	struct utmp	*utbufp,	/* holds pointer to next rec	*/			*utmp_next();	/* returns pointer to next	*/	if ( utmp_open( UTMP_FILE ) == -1 ){		perror(UTMP_FILE);		exit(1);	}	while ( ( utbufp = utmp_next() ) != ((struct utmp *) NULL) )		show_info( utbufp );	utmp_close( );	return 0;}/* *	show info() ...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -