Fix to allow raw disk access even if Large File support isn't available on the host

This commit is contained in:
Mark Pizzolato 2013-04-15 12:19:33 -07:00
parent b6e93b645e
commit 2c941c86d2

View file

@ -1970,10 +1970,17 @@ fsync ((int)((long)f));
static t_offset sim_os_disk_size_raw (FILE *f)
{
#if defined (DONT_DO_LARGEFILE)
struct stat statb;
if (fstat ((int)((long)f), &statb))
return (t_offset)-1;
#else
struct stat64 statb;
if (fstat64 ((int)((long)f), &statb))
return (t_offset)-1;
#endif
return (t_offset)statb.st_size;
}