summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/fseek.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fseek.c')
-rw-r--r--newlib/libc/stdio/fseek.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c
index 069457854..f37393cdc 100644
--- a/newlib/libc/stdio/fseek.c
+++ b/newlib/libc/stdio/fseek.c
@@ -198,7 +198,11 @@ fseek (fp, offset, whence)
{
if (seekfn != __sseek
|| fp->_file < 0
+#ifdef __CYGWIN_USE_BIG_TYPES__
+ || _fstat64_r (ptr, fp->_file, &st)
+#else
|| _fstat_r (ptr, fp->_file, &st)
+#endif
|| (st.st_mode & S_IFMT) != S_IFREG)
{
fp->_flags |= __SNPT;
@@ -221,7 +225,11 @@ fseek (fp, offset, whence)
target = offset;
else
{
+#ifdef __CYGWIN_USE_BIG_TYPES__
+ if (_fstat64_r (ptr, fp->_file, &st))
+#else
if (_fstat_r (ptr, fp->_file, &st))
+#endif
goto dumb;
target = st.st_size + offset;
}