Get rid of unnecessary barrier. Improve comment.
[pintos-anon] / grading / filesys / grow-sparse.c
1 /* -*- c -*- */
2
3 #include <syscall.h>
4 #include "fslib.h"
5
6 const char test_name[] = "grow-sparse";
7 static char buf[76543];
8
9 void
10 test_main (void) 
11 {
12   const char *filename = "testfile";
13   char zero = 0;
14   int fd;
15   
16   CHECK (create (filename, 0), "create \"%s\"", filename);
17   CHECK ((fd = open (filename)) > 1, "open \"%s\"", filename);
18   msg ("seek \"%s\"", filename);
19   seek (fd, sizeof buf - 1);
20   CHECK (write (fd, &zero, 1) > 0, "write \"%s\"", filename);
21   msg ("close \"%s\"", filename);
22   close (fd);
23   check_file (filename, buf, sizeof buf);
24 }