diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-16 13:36:10 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-16 13:39:32 +0100 |
commit | 9dd29f9aa97260c46e28ea40b987e3afb65c7251 (patch) | |
tree | a133f43f81edd841ef56acf5cdc4c5a09d469880 /Kernel/MasterPTY.h | |
parent | b46ae2bf094f8c1f59f117ded5c224980536de9f (diff) | |
download | serenity-9dd29f9aa97260c46e28ea40b987e3afb65c7251.zip |
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.
Diffstat (limited to 'Kernel/MasterPTY.h')
-rw-r--r-- | Kernel/MasterPTY.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/MasterPTY.h b/Kernel/MasterPTY.h index 0837e250a4..aa4a27daf0 100644 --- a/Kernel/MasterPTY.h +++ b/Kernel/MasterPTY.h @@ -6,7 +6,6 @@ class SlavePTY; class MasterPTY final : public CharacterDevice { - AK_MAKE_ETERNAL public: explicit MasterPTY(unsigned index); virtual ~MasterPTY() override; @@ -17,6 +16,7 @@ public: virtual bool can_write(Process&) const override; virtual bool is_master_pty() const override { return true; } + unsigned index() const { return m_index; } String pts_name() const; void on_slave_write(const byte*, size_t); |