Replace lsdir system call by readdir, isdir system calls,
[pintos-anon] / src / tests / filesys / extended / dir-open.c
1 /* Opens a directory, then tries to write to it, which must
2    fail. */
3
4 #include <syscall.h>
5 #include "tests/lib.h"
6 #include "tests/main.h"
7
8 void
9 test_main (void) 
10 {
11   int fd;
12   int retval;
13   
14   CHECK (mkdir ("xyzzy"), "mkdir \"xyzzy\"");
15   CHECK ((fd = open ("xyzzy")) > 1, "open \"xyzzy\"");
16
17   msg ("write \"xyzzy\"");
18   retval = write (fd, "foobar", 6);
19   CHECK (retval == -1,
20          "write \"xyzzy\" (must return -1, actually %d)", retval);
21 }