// S : tags c min $TAGS // S : expect --result valid // S : cc -o test.bc $CC_OPT $file // S : verify $V_OPT -o nofail:vfs test.bc #include #include #include #include #include int main() { int fd = syscall( SYS_open, "/test", O_WRONLY | O_CREAT, 0666 ); syscall( SYS_write, fd, "hello", 5ul ); syscall( SYS_close, fd ); char buf[6] = { 0 }; fd = open( "/test", O_RDONLY ); read( fd, buf, 5 ); assert( !strcmp( buf, "hello" ) ); }