ftell() operation
authorhpa <hpa>
Mon, 10 Jan 2005 02:44:17 +0000 (02:44 +0000)
committerhpa <hpa>
Mon, 10 Jan 2005 02:44:17 +0000 (02:44 +0000)
com32/lib/sys/ftell.c [new file with mode: 0644]

diff --git a/com32/lib/sys/ftell.c b/com32/lib/sys/ftell.c
new file mode 100644 (file)
index 0000000..3db2814
--- /dev/null
@@ -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;
+}
+
+