Get rid of unnecessary barrier. Improve comment.
[pintos-anon] / grading / userprog / write-normal.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <syscall.h>
4 #include "sample.inc"
5
6 int
7 main (void) 
8 {
9   int handle, byte_cnt;
10   printf ("(write-normal) begin\n");
11
12   if (!create ("test.txt", sizeof sample - 1))
13     printf ("(write-normal) create() failed\n");
14
15   handle = open ("test.txt");
16   if (handle < 2)
17     printf ("(write-normal) fail: open() returned %d\n", handle);
18
19   byte_cnt = write (handle, sample, sizeof sample - 1);
20   if (byte_cnt != sizeof sample - 1)
21     printf ("(write-normal) fail: write() returned %d instead of %zu\n",
22             byte_cnt, sizeof sample - 1);
23   
24   printf ("(write-normal) end\n");
25   return 0;
26 }