summaryrefslogtreecommitdiff
path: root/userfs.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-07-29 09:35:02 +0000
committerrtm <rtm>2006-07-29 09:35:02 +0000
commit32630628a996e29018641af262272339ed6fef88 (patch)
tree73c9a7dee75f96c0ce0e9c804d379dd60bf254b4 /userfs.c
parente46fb46fcf4302bf5ed913101c5c7b510fe03ad4 (diff)
downloadxv6-labs-32630628a996e29018641af262272339ed6fef88.tar.gz
xv6-labs-32630628a996e29018641af262272339ed6fef88.tar.bz2
xv6-labs-32630628a996e29018641af262272339ed6fef88.zip
open()
Diffstat (limited to 'userfs.c')
-rw-r--r--userfs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/userfs.c b/userfs.c
index d3a4923..c263868 100644
--- a/userfs.c
+++ b/userfs.c
@@ -8,8 +8,24 @@ char *args[] = { "echo", "hello", "goodbye", 0 };
int
main(void)
{
+ int fd;
+
puts("userfs running\n");
block();
+ fd = open("echo", 0);
+ if(fd >= 0){
+ puts("open echo ok\n");
+ close(fd);
+ } else {
+ puts("open echo failed!\n");
+ }
+ fd = open("doesnotexist", 0);
+ if(fd >= 0){
+ puts("open doesnotexist succeeded!\n");
+ close(fd);
+ } else {
+ puts("open doesnotexist failed\n");
+ }
exec("echo", args);
return 0;
}