summaryrefslogtreecommitdiff
path: root/userland/libc/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'userland/libc/stdio')
-rw-r--r--userland/libc/stdio/stdin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/userland/libc/stdio/stdin.c b/userland/libc/stdio/stdin.c
index 98189e2..2ced1a0 100644
--- a/userland/libc/stdio/stdin.c
+++ b/userland/libc/stdio/stdin.c
@@ -31,7 +31,12 @@ size_t read_fd(FILE *f, unsigned char *s, size_t l) {
// equal to the cache block size. This avoids doing a bunch of extra
// syscalls
if (l >= 4096) {
- return non_cache_read_fd(f, s, l);
+ // Invalidate the cache
+f->read_buffer_stored = 0;
+
+ size_t rc = non_cache_read_fd(f, s, l);
+ f->offset_in_file += rc;
+ return rc;
}
if (!f->read_buffer) {