aboutsummaryrefslogtreecommitdiff
path: root/libio/ftello.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/ftello.c')
-rw-r--r--libio/ftello.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libio/ftello.c b/libio/ftello.c
index dcecf5e..94a2541 100644
--- a/libio/ftello.c
+++ b/libio/ftello.c
@@ -35,7 +35,7 @@ off_t
ftello (fp)
_IO_FILE *fp;
{
- _IO_off_t pos;
+ _IO_off64_t pos;
CHECK_FILE (fp, -1L);
_IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
_IO_flockfile (fp);
@@ -55,5 +55,12 @@ ftello (fp)
#endif
return -1L;
}
+ if ((_IO_off64_t) (off_t) pos != pos)
+ {
+#ifdef EOVERFLOW
+ __set_errno (EOVERFLOW);
+#endif
+ return -1L;
+ }
return pos;
}