+/* Spawns 10 child processes, all of which read from the same
+ file and make sure that the contents are what they should
+ be. */
+
#include <random.h>
#include <stdio.h>
#include <syscall.h>
pid_t children[CHILD_CNT];
int fd;
- CHECK (create (filename, sizeof buf), "create \"%s\"", filename);
- CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
+ CHECK (create (file_name, sizeof buf), "create \"%s\"", file_name);
+ CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
random_bytes (buf, sizeof buf);
- CHECK (write (fd, buf, sizeof buf) > 0, "write \"%s\"", filename);
- msg ("close \"%s\"", filename);
+ CHECK (write (fd, buf, sizeof buf) > 0, "write \"%s\"", file_name);
+ msg ("close \"%s\"", file_name);
close (fd);
exec_children ("child-syn-read", children, CHILD_CNT);