Kernel: Handle TTY ioctls on all inodes not implementing it
This reduces debug spam while compiling software
This commit is contained in:
@@ -35,8 +35,6 @@ namespace Kernel
|
|||||||
virtual bool has_error_impl() const override { return m_reading_count == 0; }
|
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 bool has_hungup_impl() const override { return m_writing_count == 0; }
|
||||||
|
|
||||||
virtual BAN::ErrorOr<long> ioctl_impl(int, void*) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Pipe(const struct stat&);
|
Pipe(const struct stat&);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <kernel/Memory/FileBackedRegion.h>
|
#include <kernel/Memory/FileBackedRegion.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
|
||||||
namespace Kernel
|
namespace Kernel
|
||||||
@@ -317,7 +318,22 @@ namespace Kernel
|
|||||||
|
|
||||||
BAN::ErrorOr<long> Inode::ioctl(int request, void* arg)
|
BAN::ErrorOr<long> Inode::ioctl(int request, void* arg)
|
||||||
{
|
{
|
||||||
return ioctl_impl(request, arg);
|
auto ret = ioctl_impl(request, arg);
|
||||||
|
if (!ret.is_error() || ret.error().get_error_code() != ENOTSUP)
|
||||||
|
return BAN::move(ret);
|
||||||
|
|
||||||
|
switch (request)
|
||||||
|
{
|
||||||
|
case TIOCGWINSZ:
|
||||||
|
case TIOCSWINSZ:
|
||||||
|
case TCGETS:
|
||||||
|
case TCSETS:
|
||||||
|
case TCSETSW:
|
||||||
|
case TCSETSF:
|
||||||
|
return BAN::Error::from_errno(EINVAL);
|
||||||
|
default:
|
||||||
|
return BAN::Error::from_errno(ENOTSUP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BAN::ErrorOr<void> Inode::add_epoll(class Epoll* epoll)
|
BAN::ErrorOr<void> Inode::add_epoll(class Epoll* epoll)
|
||||||
|
|||||||
@@ -268,19 +268,4 @@ namespace Kernel
|
|||||||
return BAN::Error::from_errno(ENODEV);
|
return BAN::Error::from_errno(ENODEV);
|
||||||
}
|
}
|
||||||
|
|
||||||
BAN::ErrorOr<long> Pipe::ioctl_impl(int cmd, void* arg)
|
|
||||||
{
|
|
||||||
switch (cmd)
|
|
||||||
{
|
|
||||||
case TIOCGWINSZ:
|
|
||||||
case TIOCSWINSZ:
|
|
||||||
case TCGETS:
|
|
||||||
case TCSETS:
|
|
||||||
case TCSETSW:
|
|
||||||
case TCSETSF:
|
|
||||||
return BAN::Error::from_errno(EINVAL);
|
|
||||||
}
|
|
||||||
return Inode::ioctl_impl(cmd, arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user