Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
remzi-arpacidusseau
GitHub Repository: remzi-arpacidusseau/ostep-projects
Path: blob/master/initial-xv6/tests/test_1.c
909 views
1
#include "types.h"
2
#include "stat.h"
3
#include "user.h"
4
5
int
6
main(int argc, char *argv[]) {
7
int x1 = getreadcount();
8
int x2 = getreadcount();
9
char buf[100];
10
(void) read(4, buf, 1);
11
int x3 = getreadcount();
12
int i;
13
for (i = 0; i < 1000; i++) {
14
(void) read(4, buf, 1);
15
}
16
int x4 = getreadcount();
17
printf(1, "XV6_TEST_OUTPUT %d %d %d\n", x2-x1, x3-x2, x4-x3);
18
exit();
19
}
20
21