From 0bf7328e043f0e1da72537497b53815a07f1399e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 9 May 2026 21:35:51 +0300 Subject: [PATCH] Kernel: Handle TIOC{G,S}WINSZ on pipes GCC likes to do this a lot and debug logging is excessive --- kernel/include/kernel/FS/Pipe.h | 2 ++ kernel/kernel/FS/Pipe.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/kernel/include/kernel/FS/Pipe.h b/kernel/include/kernel/FS/Pipe.h index 10c441ba..86af31d0 100644 --- a/kernel/include/kernel/FS/Pipe.h +++ b/kernel/include/kernel/FS/Pipe.h @@ -44,6 +44,8 @@ namespace Kernel virtual bool has_error_impl() const override { return m_reading_count == 0; } virtual bool has_hungup_impl() const override { return m_writing_count == 0; } + virtual BAN::ErrorOr ioctl_impl(int, void*) override; + private: Pipe(const Credentials&); diff --git a/kernel/kernel/FS/Pipe.cpp b/kernel/kernel/FS/Pipe.cpp index f7ce65f3..3d96c845 100644 --- a/kernel/kernel/FS/Pipe.cpp +++ b/kernel/kernel/FS/Pipe.cpp @@ -5,6 +5,7 @@ #include #include +#include namespace Kernel { @@ -123,4 +124,16 @@ namespace Kernel return to_copy; } + + BAN::ErrorOr Pipe::ioctl_impl(int cmd, void* arg) + { + switch (cmd) + { + case TIOCGWINSZ: + case TIOCSWINSZ: + return BAN::Error::from_errno(EINVAL); + } + return Inode::ioctl_impl(cmd, arg); + } + }