// S : tags c $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 #include #include int main() { int fd = open( "file", O_CREAT | O_WRONLY, 0644 ); assert( fd >= 0 ); assert( close( fd ) == 0 ); assert( rename( "file", "renamed" ) == 0 ); errno = 0; assert( access( "file", F_OK ) == -1 ); assert( errno == ENOENT ); int r = access( "renamed", F_OK ); assert( r == 0 ); return 0; }