/* procfsreadxtime-test.c * * Just copy the /proc/xtime proc file to stdout in 80 char blocks until EOF */ /* Standard include files for syscall, see man syscall */ #include /* for printf */ #define MAXLINE 80 int main(void) { char buf[MAXLINE+1]; /* room for string terminator zero */ FILE *fp; fp = fopen("/proc/xtime", "r"); /* fgets reads one less than specified number of chars and adds zero */ while (fgets(buf, MAXLINE+1, fp) != NULL ) { printf("%s", buf); } return 0; }