summaryrefslogtreecommitdiff
path: root/userfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'userfs.c')
-rw-r--r--userfs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/userfs.c b/userfs.c
index e6dd172..56be4fc 100644
--- a/userfs.c
+++ b/userfs.c
@@ -20,7 +20,7 @@ main(void)
puts ("mknod failed\n");
else
puts ("made a node\n");
- fd = open("console", 1);
+ fd = open("console", O_WRONLY);
if(fd >= 0){
puts("open console ok\n");
} else {
@@ -45,6 +45,14 @@ main(void)
} else {
puts("open doesnotexist failed\n");
}
+
+ fd = open("doesnotexist", O_CREATE|O_RDWR);
+ if(fd >= 0){
+ puts("creat doesnotexist succeeded\n");
+ } else {
+ puts("error: creat doesnotexist failed!\n");
+ }
+ close(fd);
//exec("echo", echo_args);
exec("cat", cat_args);
return 0;