summaryrefslogtreecommitdiff
path: root/Kernel/TTY
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 20:19:35 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 22:41:17 +0200
commit664ca58746041e412bb66fac5b638d8306c27262 (patch)
treed40c3de4fe622043f783960429a9c0eb43a2f969 /Kernel/TTY
parent9ce537d7036bf4aff61d4ce10e7fe0b134c122b3 (diff)
downloadserenity-664ca58746041e412bb66fac5b638d8306c27262.zip
Kernel: Use u64 instead of size_t for File::can_write offset
This ensures offsets will not be truncated on large files on i686.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r--Kernel/TTY/MasterPTY.cpp2
-rw-r--r--Kernel/TTY/MasterPTY.h2
-rw-r--r--Kernel/TTY/PTYMultiplexer.h2
-rw-r--r--Kernel/TTY/SlavePTY.cpp2
-rw-r--r--Kernel/TTY/SlavePTY.h2
-rw-r--r--Kernel/TTY/TTY.cpp2
-rw-r--r--Kernel/TTY/TTY.h2
7 files changed, 7 insertions, 7 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index 3ec336bc17..cebb91529d 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -79,7 +79,7 @@ bool MasterPTY::can_read(const OpenFileDescription&, u64) const
return !m_buffer->is_empty();
}
-bool MasterPTY::can_write(const OpenFileDescription&, size_t) const
+bool MasterPTY::can_write(const OpenFileDescription&, u64) const
{
return true;
}
diff --git a/Kernel/TTY/MasterPTY.h b/Kernel/TTY/MasterPTY.h
index 27eb945d5c..5b5714c6f0 100644
--- a/Kernel/TTY/MasterPTY.h
+++ b/Kernel/TTY/MasterPTY.h
@@ -34,7 +34,7 @@ private:
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const OpenFileDescription&, u64) const override;
- virtual bool can_write(const OpenFileDescription&, size_t) const override;
+ virtual bool can_write(const OpenFileDescription&, u64) const override;
virtual ErrorOr<void> close() override;
virtual bool is_master_pty() const override { return true; }
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
diff --git a/Kernel/TTY/PTYMultiplexer.h b/Kernel/TTY/PTYMultiplexer.h
index e3c395d32f..caac7b0fdd 100644
--- a/Kernel/TTY/PTYMultiplexer.h
+++ b/Kernel/TTY/PTYMultiplexer.h
@@ -27,7 +27,7 @@ public:
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override { return 0; }
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override { return 0; }
virtual bool can_read(const OpenFileDescription&, u64) const override { return true; }
- virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
+ virtual bool can_write(const OpenFileDescription&, u64) const override { return true; }
void notify_master_destroyed(Badge<MasterPTY>, unsigned index);
diff --git a/Kernel/TTY/SlavePTY.cpp b/Kernel/TTY/SlavePTY.cpp
index b5a46daf8d..3c431a4158 100644
--- a/Kernel/TTY/SlavePTY.cpp
+++ b/Kernel/TTY/SlavePTY.cpp
@@ -85,7 +85,7 @@ ErrorOr<size_t> SlavePTY::on_tty_write(const UserOrKernelBuffer& data, size_t si
return m_master->on_slave_write(data, size);
}
-bool SlavePTY::can_write(const OpenFileDescription&, size_t) const
+bool SlavePTY::can_write(const OpenFileDescription&, u64) const
{
return m_master->can_write_from_slave();
}
diff --git a/Kernel/TTY/SlavePTY.h b/Kernel/TTY/SlavePTY.h
index 1e1cb89177..73e283c38f 100644
--- a/Kernel/TTY/SlavePTY.h
+++ b/Kernel/TTY/SlavePTY.h
@@ -34,7 +34,7 @@ private:
// ^CharacterDevice
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 bool can_write(const OpenFileDescription&, u64) const override;
virtual StringView class_name() const override { return "SlavePTY"sv; }
virtual ErrorOr<void> close() override;
diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp
index 237f10eff4..1703e4b926 100644
--- a/Kernel/TTY/TTY.cpp
+++ b/Kernel/TTY/TTY.cpp
@@ -147,7 +147,7 @@ bool TTY::can_read(const OpenFileDescription&, u64) const
return !m_input_buffer.is_empty();
}
-bool TTY::can_write(const OpenFileDescription&, size_t) const
+bool TTY::can_write(const OpenFileDescription&, u64) const
{
return true;
}
diff --git a/Kernel/TTY/TTY.h b/Kernel/TTY/TTY.h
index 06dc967b43..1c49b9e1bb 100644
--- a/Kernel/TTY/TTY.h
+++ b/Kernel/TTY/TTY.h
@@ -24,7 +24,7 @@ public:
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
virtual bool can_read(const OpenFileDescription&, u64) const override;
- virtual bool can_write(const OpenFileDescription&, size_t) const override;
+ virtual bool can_write(const OpenFileDescription&, u64) const override;
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override final;
virtual ErrorOr<NonnullOwnPtr<KString>> pseudo_path(const OpenFileDescription&) const override;