|
以下代码使用gcc 编译不过去请哪位说说哪里错误
- #include <stdio.h>
- #include <utmp.h>
- #include <fcntl.h>
- #include <unistd.h>
- #define SHOWHOST
- void show_info(struct utmp * utbufp);
-
- int main()
- {
- struct utmp current_record;
- int utmpfd;
- int reclen=sizeof(current_record);
- if((utmpfd=open(UTMP_FILE,0_RDONLY))== -1)
- {
- perror(UTMP_FILE);
- exit(1);
- }
- while(read(utmpfd,¤t_record,reclen)==reclen)
- show_line(¤t_record);
- close(utmptd);
- return 0;
- }
- void show_info(struct utmp * utbufp)
- {
- printf("%-8.8s",utbufp->ut_name);
- printf(" ");
- }
复制代码 :help |
|