1 /* Child process for syn-read test.
2 Writes into part of a test file. Other processes will be
3 writing into other parts at the same time. */
9 #include "tests/filesys/base/syn-write.h"
14 main (int argc, char *argv[])
21 CHECK (argc == 2, "argc must be 2, actually %d", argc);
22 child_idx = atoi (argv[1]);
25 random_bytes (buf, sizeof buf);
27 CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
28 seek (fd, CHUNK_SIZE * child_idx);
29 CHECK (write (fd, buf + CHUNK_SIZE * child_idx, CHUNK_SIZE) > 0,
30 "write \"%s\"", file_name);
31 msg ("close \"%s\"", file_name);