FreeBSD/contrib/netbsd-tests/fs/vfs/t_vfsops.c
/*
 * This test only checks the file system doesn't crash.  We *might*
 * try a valid file handle.
 */
This test only checks the file system doesn't crash.  We *might
try a valid file handle.
This test only checks the file system doesn ' t crash . We * might try a valid file handle .
static void
tfhinval(const atf_tc_t *tc, const char *path)
{
	size_t fhsize;
	void *fhp;
	unsigned long seed;
	int fd;
	srandom(seed = time(NULL));
	printf("RNG seed %lu\n", seed);
	RL(rump_sys_chdir(path));
	fhsize = 0;
	if (rump_sys_getfh(".", NULL, &fhsize) == -1) {
		if (errno == EOPNOTSUPP) {
			atf_tc_skip("file handles not supported");
		} else if (errno != E2BIG) {
			atf_tc_fail_errno("getfh size");
		}
	}
	fhp = malloc(fhsize);
	tests_makegarbage(fhp, fhsize);
	fd = rump_sys_fhopen(fhp, fhsize, O_RDWR);
	if (fd != -1)
		rump_sys_close(fd);
	RL(rump_sys_chdir("/"));
}
static void tfhinval ( const atf_tc_t * tc , const char * path ) { size_t fhsize ; void * fhp ; unsigned long seed ; int fd ; srandom ( seed = time ( NULL ) ) ; printf ( " \n " , seed ) ; RL ( rump_sys_chdir ( path ) ) ; fhsize = 0 ; if ( rump_sys_getfh ( " " , NULL , & fhsize ) == -1 ) { if ( errno == EOPNOTSUPP ) { atf_tc_skip ( " " ) ; } else if ( errno != E2BIG ) { atf_tc_fail_errno ( " " ) ; } } fhp = malloc ( fhsize ) ; tests_makegarbage ( fhp , fhsize ) ; fd = rump_sys_fhopen ( fhp , fhsize , O_RDWR ) ; if ( fd != -1 ) rump_sys_close ( fd ) ; RL ( rump_sys_chdir ( " " ) ) ; }
This test only checks the file system doesn't crash.
This test only checks the file system doesn ' t crash .