summaryrefslogtreecommitdiff
path: root/com32/lib/sys/ftell.c
blob: d8090087b28b4eee4e258a29a7704c4be2c52d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 - fp->i.unread_bytes;
}