1 /* Tests that seeking past the end of a file and writing will
2 properly zero out the region in between. */
6 #include "tests/main.h"
8 static char buf[76543];
13 const char *file_name = "testfile";
17 CHECK (create (file_name, 0), "create \"%s\"", file_name);
18 CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name);
19 msg ("seek \"%s\"", file_name);
20 seek (fd, sizeof buf - 1);
21 CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", file_name);
22 msg ("close \"%s\"", file_name);
24 check_file (file_name, buf, sizeof buf);