X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Ffilesys%2Fbase%2Fchild-syn-read.c;h=e426fadc570ba4804e667e61e49a05e6c92d66af;hb=c0206643b024b6f0e6cde1cbb5e7d37abbc84c69;hp=8f3ccc4017b1493e9cc5df4d9a76068ca2d223e4;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/tests/filesys/base/child-syn-read.c b/src/tests/filesys/base/child-syn-read.c index 8f3ccc4..e426fad 100644 --- a/src/tests/filesys/base/child-syn-read.c +++ b/src/tests/filesys/base/child-syn-read.c @@ -1,3 +1,9 @@ +/* Child process for syn-read test. + Reads the contents of a test file a byte at a time, in the + hope that this will take long enough that we can get a + significant amount of contention in the kernel file system + code. */ + #include #include #include @@ -22,12 +28,12 @@ main (int argc, const char *argv[]) random_init (0); random_bytes (buf, sizeof buf); - CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename); + CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); for (i = 0; i < sizeof buf; i++) { char c; - CHECK (read (fd, &c, 1) > 0, "read \"%s\"", filename); - compare_bytes (&c, buf + i, 1, i, filename); + CHECK (read (fd, &c, 1) > 0, "read \"%s\"", file_name); + compare_bytes (&c, buf + i, 1, i, file_name); } close (fd);