Function _telli64 is available since msvcrt20.dll and is used by mingw-w64
ftruncate64 implementation.
---
mingw-w64-crt/Makefile.am | 1 +
mingw-w64-crt/stdio/_telli64.c | 11 +++++++++++
mingw-w64-crt/testcases/t_lfs.c | 1 +
3 files changed, 13 insertions(+)
create mode 100644 mingw-w64-crt/stdio/_telli64.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index ca3e85264172..d18cd7e440a5 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -845,6 +845,7 @@ src_pre_msvcrt20=\
misc/__p__winver.c \
misc/__timezone.c \
misc/__tzname.c \
+ stdio/_telli64.c \
stdio/fgetws.c \
stdio/fputws.c \
stdio/iob_func.c
diff --git a/mingw-w64-crt/stdio/_telli64.c b/mingw-w64-crt/stdio/_telli64.c
new file mode 100644
index 000000000000..439113978c85
--- /dev/null
+++ b/mingw-w64-crt/stdio/_telli64.c
@@ -0,0 +1,11 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <io.h>
+#include <unistd.h>
+
+__int64 __cdecl _telli64(int fd) { return _lseeki64(fd, 0, SEEK_CUR); }
+__int64 (__cdecl *__MINGW_IMP_SYMBOL(_telli64))(int) = _telli64;
diff --git a/mingw-w64-crt/testcases/t_lfs.c b/mingw-w64-crt/testcases/t_lfs.c
index 9079e83b1a08..a5a33ce97126 100644
--- a/mingw-w64-crt/testcases/t_lfs.c
+++ b/mingw-w64-crt/testcases/t_lfs.c
@@ -16,6 +16,7 @@ int main(int argc, char *argv[]) {
fsetpos64(stdin, &pos);
lseek64(STDIN_FILENO, 0, SEEK_CUR);
_lseeki64(STDIN_FILENO, 0, SEEK_CUR);
+ _telli64(STDIN_FILENO);
file = fopen64(argc >= 2 ? argv[1] : argv[0], "r");
if (file) {
freopen64(argc >= 2 ? argv[1] : argv[0], "r", file);
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public