diff options
Diffstat (limited to 'src/stdio/ftell.c')
| -rw-r--r-- | src/stdio/ftell.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/stdio/ftell.c b/src/stdio/ftell.c index f68c18b2..ad23bf31 100644 --- a/src/stdio/ftell.c +++ b/src/stdio/ftell.c @@ -5,15 +5,21 @@ long int ftell(FILE *stream) { + long int ret = -1L; + SIGNAL_SAFE(0); + ASSERT_STREAM(stream, 0, 0); - (void)stream; - /* TODO */ /* RETURN_SUCCESS(the current file position); RETURN_FAILURE(LITERAL(-1L)); */ - return -1L; + + if (stream->text) { + ADD_PREV(ret, stream->valid_ftell, stream->nvalid_ftell); + } + + return ret; } /*** |
