1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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; }