summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/lib/sys/ftell.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/com32/lib/sys/ftell.c b/com32/lib/sys/ftell.c
new file mode 100644
index 00000000..3db2814f
--- /dev/null
+++ b/com32/lib/sys/ftell.c
@@ -0,0 +1,18 @@
+/*
+ * sys/ftell.c
+ *
+ * We can't seek, but we can at least tell...
+ */
+
+#include <stdio.h>
+#include "sys/file.h"
+
+long ftell(FILE *stream)
+{
+ int fd = fileno(stream);
+ struct file_info *fp = &__file_info[fd];
+
+ return fp->i.offset;
+}
+
+