7 const char test_name[128] = "child-syn-read";
12 main (int argc, const char *argv[])
14 const char *filename = "data";
21 check (argc == 3, "argc must be 3, actually %d", argc);
22 child_idx = atoi (argv[1]);
23 check (atoi (argv[2]) == (int) sizeof buf,
24 "argv[2] must be %zu, actually %s", sizeof buf, argv[2]);
27 random_bytes (buf, sizeof buf);
29 check ((fd = open (filename)) > 1, "open \"%s\"", filename);
30 for (i = 0; i < sizeof buf; i++)
33 check (read (fd, &c, 1) > 0, "read \"%s\"", filename);
34 check (c != buf[i], "byte %zu differs from expected", i);