break;
num++;
diag_printf("<INFO>: entry %14s",entry->d_name);
+#ifdef CYGPKG_FS_FAT_RET_DIRENT_DTYPE
+ diag_printf(" d_type %2x", entry->d_type);
+#endif
if( statp )
{
char fullname[PATH_MAX];
diag_printf(" [mode %08x ino %08x nlink %d size %ld]",
sbuf.st_mode,sbuf.st_ino,sbuf.st_nlink,(long)sbuf.st_size);
}
+#ifdef CYGPKG_FS_FAT_RET_DIRENT_DTYPE
+ if ((entry->d_type & S_IFMT) != (sbuf.st_mode & S_IFMT))
+ CYG_TEST_FAIL("File mode's don't match between dirent and stat");
+#endif
}
diag_printf("\n");
int i;
int err;
- diag_printf("<INFO>: create file %s size %d\n",name,size);
+ diag_printf("<INFO>: create file %s size %zd \n",name,size);
err = access( name, F_OK );
if( err < 0 && errno != EACCES ) SHOW_RESULT( access, err );
if( (size-prevsize) > 100000 )
{
- diag_printf("<INFO>: size = %d \n", size);
+ diag_printf("<INFO>: size = %zd \n", size);
prevsize = size;
}
} while( wrote == IOSIZE );
- diag_printf("<INFO>: file size == %d\n",size);
+ diag_printf("<INFO>: file size == %zd\n",size);
err = close( fd );
if( err < 0 ) SHOW_RESULT( close, err );
{
int err;
int existingdirents=-1;
+#if defined(CYGSEM_FILEIO_BLOCK_USAGE)
+ struct cyg_fs_block_usage usage;
+#endif
CYG_TEST_INIT();
listdir( "/", true, -1, &existingdirents );
// --------------------------------------------------------------
+#if defined(CYGSEM_FILEIO_BLOCK_USAGE)
+ err = cyg_fs_getinfo("/", FS_INFO_BLOCK_USAGE, &usage, sizeof(usage));
+ if( err < 0 ) SHOW_RESULT( cyg_fs_getinfo, err );
+ diag_printf("<INFO>: total size: %6lld blocks, %10lld bytes\n",
+ usage.total_blocks, usage.total_blocks * usage.block_size);
+ diag_printf("<INFO>: free size: %6lld blocks, %10lld bytes\n",
+ usage.free_blocks, usage.free_blocks * usage.block_size);
+ diag_printf("<INFO>: block size: %6u bytes\n", usage.block_size);
+#endif
+ // --------------------------------------------------------------
createfile( "/foo", 20257 );
checkfile( "foo" );
checkfile( "/bar/bundy" );
comparefiles("/fee", "bundy" );
+#if defined(CYGSEM_FILEIO_BLOCK_USAGE)
+ err = cyg_fs_getinfo("/", FS_INFO_BLOCK_USAGE, &usage, sizeof(usage));
+ if( err < 0 ) SHOW_RESULT( cyg_fs_getinfo, err );
+ diag_printf("<INFO>: total size: %6lld blocks, %10lld bytes\n",
+ usage.total_blocks, usage.total_blocks * usage.block_size);
+ diag_printf("<INFO>: free size: %6lld blocks, %10lld bytes\n",
+ usage.free_blocks, usage.free_blocks * usage.block_size);
+ diag_printf("<INFO>: block size: %6u bytes\n", usage.block_size);
+#endif
// --------------------------------------------------------------
diag_printf("<INFO>: unlink fee\n");