From 5a2d71553c23fd92e884d3f40ca855c0f6600d28 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 28 Jun 2025 04:51:07 +0300 Subject: [PATCH] FS: Add missing file seeks --- src/core/kernel/file_operations.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/kernel/file_operations.cpp b/src/core/kernel/file_operations.cpp index 2b2020d1..52dd7493 100644 --- a/src/core/kernel/file_operations.cpp +++ b/src/core/kernel/file_operations.cpp @@ -14,7 +14,6 @@ namespace FileOps { }; } - void Kernel::handleFileOperation(u32 messagePointer, Handle file) { const u32 cmd = mem.read32(messagePointer); switch (cmd) { @@ -89,6 +88,7 @@ void Kernel::readFile(u32 messagePointer, Handle fileHandle) { if (file->fd) { std::unique_ptr data(new u8[size]); IOFile f(file->fd); + f.seek(offset); auto [success, bytesRead] = f.readBytes(data.get(), size); @@ -146,6 +146,7 @@ void Kernel::writeFile(u32 messagePointer, Handle fileHandle) { } IOFile f(file->fd); + f.seek(offset); auto [success, bytesWritten] = f.writeBytes(data.get(), size); // TODO: Should this check only the byte?