summaryrefslogtreecommitdiff
path: root/libio/ftello.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/ftello.c')
-rw-r--r--libio/ftello.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libio/ftello.c b/libio/ftello.c
index 7122815f2e..5a3caf4ad9 100644
--- a/libio/ftello.c
+++ b/libio/ftello.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,16 +24,19 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
+/* We need to disable the redirect for __ftello64 for the alias
+ definitions below to work. */
+#define __ftello64 __ftello64_disable
+
#include <stdio.h>
#include <stdlib.h>
#include <libioP.h>
#include <errno.h>
-
off_t
-__ftello (_IO_FILE *fp)
+__ftello (FILE *fp)
{
- _IO_off64_t pos;
+ off64_t pos;
CHECK_FILE (fp, -1L);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
@@ -45,17 +48,13 @@ __ftello (_IO_FILE *fp)
_IO_release_lock (fp);
if (pos == _IO_pos_BAD)
{
-#ifdef EIO
if (errno == 0)
__set_errno (EIO);
-#endif
return -1L;
}
- if ((_IO_off64_t) (off_t) pos != pos)
+ if ((off64_t) (off_t) pos != pos)
{
-#ifdef EOVERFLOW
__set_errno (EOVERFLOW);
-#endif
return -1L;
}
return pos;
@@ -65,4 +64,7 @@ weak_alias (__ftello, ftello)
#ifdef __OFF_T_MATCHES_OFF64_T
weak_alias (__ftello, ftello64)
+# undef __ftello64
+strong_alias (__ftello, __ftello64)
+libc_hidden_ver (__ftello, __ftello64)
#endif