4 #include "tests/filesys/extended/syn-rw.h"
7 const char *test_name = "child-syn-rw";
9 static char buf1[BUF_SIZE];
10 static char buf2[BUF_SIZE];
13 main (int argc, const char *argv[])
21 CHECK (argc == 2, "argc must be 2, actually %d", argc);
22 child_idx = atoi (argv[1]);
25 random_bytes (buf1, sizeof buf1);
27 CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
29 while (ofs < sizeof buf2)
31 int bytes_read = read (fd, buf2 + ofs, sizeof buf2 - ofs);
32 CHECK (bytes_read >= -1 && bytes_read <= (int) (sizeof buf2 - ofs),
33 "%zu-byte read on \"%s\" returned invalid value of %d",
34 sizeof buf2 - ofs, filename, bytes_read);
37 compare_bytes (buf2 + ofs, buf1 + ofs, bytes_read, ofs, filename);