xv6/userfs.c

32 lines
502 B
C
Raw Normal View History

#include "user.h"
2006-07-10 16:27:15 +00:00
// file system tests
char buf[1024];
2006-07-28 22:33:07 +00:00
char *args[] = { "echo", "hello", "goodbye", 0 };
2006-07-10 16:27:15 +00:00
int
2006-07-17 01:25:22 +00:00
main(void)
2006-07-10 16:27:15 +00:00
{
2006-07-29 09:35:02 +00:00
int fd;
2006-07-11 01:07:40 +00:00
puts("userfs running\n");
2006-07-10 16:27:15 +00:00
block();
2006-07-29 09:35:02 +00:00
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");
}
2006-07-28 22:33:07 +00:00
exec("echo", args);
return 0;
2006-07-10 16:27:15 +00:00
}