libc: io: implement file io buffering and internal locking for concurrency

This commit is contained in:
2026-04-01 18:51:13 +01:00
parent f2e650d368
commit 548387c43a
23 changed files with 948 additions and 73 deletions
+6 -3
View File
@@ -15,10 +15,13 @@ int fclose(struct __opaque_file *stream)
close(stream->f_fd);
if (stream->f_buf) {
free(stream->f_buf);
if (stream->f_buf.buf_ptr) {
free(stream->f_buf.buf_ptr);
}
if (!(stream->f_flags & FILE_STATIC)) {
free(stream);
}
free(stream);
return SUCCESS;
}