projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
defined 'test_name' for msg()/vmsg() to work properly
[pintos-anon]
/
src
/
tests
/
filesys
/
base
/
child-syn-read.c
diff --git
a/src/tests/filesys/base/child-syn-read.c
b/src/tests/filesys/base/child-syn-read.c
index 8f3ccc4017b1493e9cc5df4d9a76068ca2d223e4..77a5e26252f6116cb2b25e2c7add0bb5e9787cb1 100644
(file)
--- 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 <random.h>
#include <stdio.h>
#include <stdlib.h>
#include <random.h>
#include <stdio.h>
#include <stdlib.h>
@@
-5,6
+11,8
@@
#include "tests/lib.h"
#include "tests/filesys/base/syn-read.h"
#include "tests/lib.h"
#include "tests/filesys/base/syn-read.h"
+const char *test_name = "child-syn-read";
+
static char buf[BUF_SIZE];
int
static char buf[BUF_SIZE];
int
@@
-22,12
+30,12
@@
main (int argc, const char *argv[])
random_init (0);
random_bytes (buf, sizeof buf);
random_init (0);
random_bytes (buf, sizeof buf);
- CHECK ((fd = open (file
name)) > 1, "open \"%s\"", file
name);
+ CHECK ((fd = open (file
_name)) > 1, "open \"%s\"", file_
name);
for (i = 0; i < sizeof buf; i++)
{
char c;
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);
}
close (fd);