summaryrefslogtreecommitdiffstats
path: root/osdep/ftello.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/ftello.c')
-rw-r--r--osdep/ftello.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/osdep/ftello.c b/osdep/ftello.c
new file mode 100644
index 0000000000..d11710b89f
--- /dev/null
+++ b/osdep/ftello.c
@@ -0,0 +1,19 @@
+/*
+ * ftello.c
+ * 64-bit version of ftello() for systems which do not have it
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <sys/types.h>
+
+off_t
+ftello(FILE *stream)
+{
+ fpos_t floc;
+
+ if (fgetpos(stream, &floc) != 0)
+ return -1;
+ return floc;
+}