options/glibc: Implemented __freadahead()
@@ -46,9 +46,12 @@ void _flushlbf(void) {
// The following functions are defined by musl.
-size_t __freadahead(FILE *) {
- __ensure(!"Not implemented");
- __builtin_unreachable();
+size_t __freadahead(FILE *file_base) {
+ if(file_base->__io_mode != 0) {
+ mlibc::infoLogger() << "mlibc: __freadahead() called but file is not open for reading" << frg::endlog;
+ return 0;
+ }
+ return file_base->__valid_limit - file_base->__offset;
}
const char *__freadptr(FILE *, size_t *) {
__ensure(!"Not implemented");
