9 const char test_name[128] = "child-syn-rw";
11 static char buf1[BUF_SIZE];
12 static char buf2[BUF_SIZE];
15 main (int argc, const char *argv[])
23 CHECK (argc == 2, "argc must be 2, actually %d", argc);
24 child_idx = atoi (argv[1]);
27 random_bytes (buf1, sizeof buf1);
29 CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
31 while (ofs < sizeof buf2)
33 int bytes_read = read (fd, buf2 + ofs, sizeof buf2 - ofs);
34 CHECK (bytes_read >= -1 && bytes_read <= (int) (sizeof buf2 - ofs),
35 "%zu-byte read on \"%s\" returned invalid value of %d",
36 sizeof buf2 - ofs, filename, bytes_read);
39 compare_bytes (buf2 + ofs, buf1 + ofs, bytes_read, ofs, filename);