summaryrefslogtreecommitdiff
path: root/Kernel/Bus
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 20:17:49 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 22:41:17 +0200
commit9ce537d7036bf4aff61d4ce10e7fe0b134c122b3 (patch)
tree3dc45992db0acbfad56c0555821909432a1f86cd /Kernel/Bus
parent0c630d568721f1efba2d5c0ee72c52c08b43d6e8 (diff)
downloadserenity-9ce537d7036bf4aff61d4ce10e7fe0b134c122b3.zip
Kernel: Use u64 instead of size_t for File::can_read offset
This ensures offsets will not be truncated on large files on i686.
Diffstat (limited to 'Kernel/Bus')
-rw-r--r--Kernel/Bus/VirtIO/ConsolePort.cpp2
-rw-r--r--Kernel/Bus/VirtIO/ConsolePort.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Bus/VirtIO/ConsolePort.cpp b/Kernel/Bus/VirtIO/ConsolePort.cpp
index 8545aac8ae..e30b227cd4 100644
--- a/Kernel/Bus/VirtIO/ConsolePort.cpp
+++ b/Kernel/Bus/VirtIO/ConsolePort.cpp
@@ -85,7 +85,7 @@ void ConsolePort::handle_queue_update(Badge<VirtIO::Console>, u16 queue_index)
}
}
-bool ConsolePort::can_read(const OpenFileDescription&, size_t) const
+bool ConsolePort::can_read(const OpenFileDescription&, u64) const
{
return m_receive_buffer->used_bytes() > 0;
}
diff --git a/Kernel/Bus/VirtIO/ConsolePort.h b/Kernel/Bus/VirtIO/ConsolePort.h
index 81a8aca874..44c50f09b9 100644
--- a/Kernel/Bus/VirtIO/ConsolePort.h
+++ b/Kernel/Bus/VirtIO/ConsolePort.h
@@ -37,7 +37,7 @@ private:
virtual StringView class_name() const override { return "VirtIOConsolePort"sv; }
- virtual bool can_read(const OpenFileDescription&, size_t) const override;
+ virtual bool can_read(const OpenFileDescription&, u64) const override;
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
virtual bool can_write(const OpenFileDescription&, size_t) const override;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;