diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-06-19 01:35:23 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-06-19 01:35:23 -0400 |
commit | e15171b8d8e80e8b5bcf4e95b1709697858f545a (patch) | |
tree | 36063ba211b93e894fb891db9e04599b70e86f6e /src | |
parent | a71e0af25544fd2486e57ea51c6d05abdbf44c3e (diff) | |
download | musl-e15171b8d8e80e8b5bcf4e95b1709697858f545a.tar.gz musl-e15171b8d8e80e8b5bcf4e95b1709697858f545a.tar.xz musl-e15171b8d8e80e8b5bcf4e95b1709697858f545a.zip |
add new stdio extension functions to make gnulib happy
this is mildly ugly, but less ugly than gnulib trying to poke at the definition of the FILE structure...
Diffstat (limited to 'src')
-rw-r--r-- | src/stdio/ext2.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stdio/ext2.c b/src/stdio/ext2.c new file mode 100644 index 00000000..e587d64b --- /dev/null +++ b/src/stdio/ext2.c @@ -0,0 +1,24 @@ +#include "stdio_impl.h" + +size_t __freadahead(FILE *f) +{ + return f->rend - f->rpos; +} + +const char *__freadptr(FILE *f, size_t *sizep) +{ + size_t size = f->rend - f->rpos; + if (!size) return 0; + *sizep = size; + return f->rpos; +} + +void __freadptrinc(FILE *f, size_t inc) +{ + f->rpos += inc; +} + +void __fseterr(FILE *f) +{ + f->flags |= F_ERR; +} |