+/* Child process for syn-read test.
+ Writes into part of a test file. Other processes will be
+ writing into other parts at the same time. */
+
#include <random.h>
#include <stdlib.h>
#include <syscall.h>
random_init (0);
random_bytes (buf, sizeof buf);
- CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
+ CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
seek (fd, CHUNK_SIZE * child_idx);
CHECK (write (fd, buf + CHUNK_SIZE * child_idx, CHUNK_SIZE) > 0,
- "write \"%s\"", filename);
- msg ("close \"%s\"", filename);
+ "write \"%s\"", file_name);
+ msg ("close \"%s\"", file_name);
close (fd);
return child_idx;