diff options
author | kaashoek <kaashoek> | 2006-08-09 19:25:20 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-08-09 19:25:20 +0000 |
commit | 939f9edeac042b2678bd2943a32822fb2eed75b4 (patch) | |
tree | 0e7be15b11b6686f406b2bb67aca4781d6792ff7 /userfs.c | |
parent | 2601de00325bebd850fb74409e77e68d52b7021a (diff) | |
download | xv6-labs-939f9edeac042b2678bd2943a32822fb2eed75b4.tar.gz xv6-labs-939f9edeac042b2678bd2943a32822fb2eed75b4.tar.bz2 xv6-labs-939f9edeac042b2678bd2943a32822fb2eed75b4.zip |
iread for T_DEV
O_RDWR, etc.
create file
Diffstat (limited to 'userfs.c')
-rw-r--r-- | userfs.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |