Fix to allow raw disk access even if Large File support isn't available on the host
This commit is contained in:
parent
b6e93b645e
commit
2c941c86d2
1 changed files with 188 additions and 181 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue