From 9efad5f8d3ebbecdf8221d871f43bcbd15f1ac7d Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sun, 22 Oct 2023 23:22:32 +0200 Subject: libc: Add a cache to the fread function for reading from files on disk. This helps a ton when using functions such as fscanf that reads from a FILE byte by byte. By creating a cache it avoids a ton of 'read' syscalls that would otherwise be made. --- userland/libc/include/stdio.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'userland/libc/include') diff --git a/userland/libc/include/stdio.h b/userland/libc/include/stdio.h index 014e2ac..22afbb2 100644 --- a/userland/libc/include/stdio.h +++ b/userland/libc/include/stdio.h @@ -34,6 +34,9 @@ struct __IO_FILE { uint8_t is_eof; uint8_t has_error; uint64_t file_size; + uint8_t *read_buffer; + uint32_t read_buffer_stored; + uint32_t read_buffer_has_read; void *cookie; }; -- cgit v1.2.3