diff options
author | Anton Kling <anton@kling.gg> | 2023-10-22 23:22:32 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-22 23:22:32 +0200 |
commit | 9efad5f8d3ebbecdf8221d871f43bcbd15f1ac7d (patch) | |
tree | a7313186ea8dd331672dbd4c042f83731d2a1f7e /userland/libc/include | |
parent | 056216a800098ba98211ede122d974bf94a4e319 (diff) |
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.
Diffstat (limited to 'userland/libc/include')
-rw-r--r-- | userland/libc/include/stdio.h | 3 |
1 files changed, 3 insertions, 0 deletions
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; }; |