summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/com32/lib/sys/ftell.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syslinux-4.02/com32/lib/sys/ftell.c')
-rw-r--r--contrib/syslinux-4.02/com32/lib/sys/ftell.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/lib/sys/ftell.c b/contrib/syslinux-4.02/com32/lib/sys/ftell.c
new file mode 100644
index 0000000..5c1a944
--- /dev/null
+++ b/contrib/syslinux-4.02/com32/lib/sys/ftell.c
@@ -0,0 +1,16 @@
+/*
+ * 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;
+}