From f8edb0e82019cd36dc20abafda23ca523ccc0c13 Mon Sep 17 00:00:00 2001 From: hpa Date: Mon, 10 Jan 2005 02:44:17 +0000 Subject: [PATCH] ftell() operation --- com32/lib/sys/ftell.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 com32/lib/sys/ftell.c diff --git a/com32/lib/sys/ftell.c b/com32/lib/sys/ftell.c new file mode 100644 index 0000000..3db2814 --- /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 +#include "sys/file.h" + +long ftell(FILE *stream) +{ + int fd = fileno(stream); + struct file_info *fp = &__file_info[fd]; + + return fp->i.offset; +} + + -- 2.7.4