source:
trunk/sys/dietlibc/ftell.c
@
90
Last change on this file since 90 was 1, checked in by , 8 years ago | |
---|---|
File size: 376 bytes |
Line | |
---|---|
1 | #include "dietstdio.h" |
2 | #include <unistd.h> |
3 | #include <errno.h> |
4 | |
5 | long ftell_unlocked(FILE *stream) { |
6 | off_t l; |
7 | if (stream->flags&3 || (l=lseek(stream->fd,0,SEEK_CUR))==-1) return -1; |
8 | if (stream->flags&BUFINPUT) |
9 | return l-(stream->bs-stream->bm)-stream->ungotten; |
10 | else |
11 | return l+stream->bm; |
12 | } |
13 | |
14 | long ftell(FILE *stream) __attribute__((weak,alias("ftell_unlocked"))); |
Note: See TracBrowser
for help on using the repository browser.