From 9dd29f9aa97260c46e28ea40b987e3afb65c7251 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 16 Jan 2019 13:36:10 +0100 Subject: Add a PTY multiplexer (/dev/ptmx) device. When you open /dev/ptmx, you get a file descriptor pointing to one of the available MasterPTY's. If none are available, you get an EBUSY. This makes it possible to open multiple (up to 4) Terminals. :^) To support this, I also added a CharacterDevice::open() that gets control when VFS is opening a CharacterDevice. This is useful when we want to return a custom FileDescriptor like we do here. --- Kernel/SlavePTY.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel/SlavePTY.h') diff --git a/Kernel/SlavePTY.h b/Kernel/SlavePTY.h index 773dcee6b4..1b01219349 100644 --- a/Kernel/SlavePTY.h +++ b/Kernel/SlavePTY.h @@ -5,13 +5,13 @@ class MasterPTY; class SlavePTY final : public TTY { - AK_MAKE_ETERNAL public: virtual ~SlavePTY() override; virtual String tty_name() const override; void on_master_write(const byte*, size_t); + unsigned index() const { return m_index; } protected: virtual void on_tty_write(const byte*, size_t) override; -- cgit v1.2.3