summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r--newlib/libc/stdio/fseek.c8
-rw-r--r--newlib/libc/stdio/makebuf.c4
-rw-r--r--newlib/libc/stdio/mktemp.c8
3 files changed, 20 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;
}
diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c
index 4a09c4d50..afb1e2d82 100644
--- a/newlib/libc/stdio/makebuf.c
+++ b/newlib/libc/stdio/makebuf.c
@@ -47,7 +47,11 @@ __smakebuf (fp)
fp->_bf._size = 1;
return;
}
+#ifdef __CYGWIN_USE_BIG_TYPES__
+ if (fp->_file < 0 || _fstat64_r (fp->_data, fp->_file, &st) < 0)
+#else
if (fp->_file < 0 || _fstat_r (fp->_data, fp->_file, &st) < 0)
+#endif
{
couldbetty = 0;
size = BUFSIZ;
diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c
index f3eaa09ce..24bbf67e1 100644
--- a/newlib/libc/stdio/mktemp.c
+++ b/newlib/libc/stdio/mktemp.c
@@ -132,7 +132,11 @@ _DEFUN (_gettemp, (ptr, path, doopen),
if (*trv == '/')
{
*trv = '\0';
+#ifdef __CYGWIN_USE_BIG_TYPES__
+ if (_stat64_r (ptr, path, &sbuf))
+#else
if (_stat_r (ptr, path, &sbuf))
+#endif
return (0);
if (!(sbuf.st_mode & S_IFDIR))
{
@@ -158,7 +162,11 @@ _DEFUN (_gettemp, (ptr, path, doopen),
#endif
return 0;
}
+#ifdef __CYGWIN_USE_BIG_TYPES__
+ else if (_stat64_r (ptr, path, &sbuf))
+#else
else if (_stat_r (ptr, path, &sbuf))
+#endif
return (ptr->_errno == ENOENT ? 1 : 0);
/* tricky little algorithm for backward compatibility */