summaryrefslogtreecommitdiff
path: root/user/stats.c
blob: f8c91384e6402f6e03dc3f8f46e5ae1aee6c2097 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "kernel/types.h"
#include "kernel/stat.h"
#include "kernel/fcntl.h"
#include "user/user.h"

#define SZ 4096
char buf[SZ];

int
main(void)
{
  int i, n;
  
  while (1) {
    n = statistics(buf, SZ);
    for (i = 0; i < n; i++) {
      write(1, buf+i, 1);
    }
    if (n != SZ)
      break;
  }

  exit(0);
}