1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 13:27:34 +00:00

Kernel: Move TTY-related files into Kernel/TTY/.

This commit is contained in:
Andreas Kling 2019-04-03 12:28:45 +02:00
parent f9864940eb
commit 9fca94269e
17 changed files with 16 additions and 16 deletions

View file

@ -0,0 +1,32 @@
#pragma once
#include <Kernel/CharacterDevice.h>
#include <AK/Badge.h>
#include <Kernel/Lock.h>
class MasterPTY;
class PTYMultiplexer final : public CharacterDevice {
AK_MAKE_ETERNAL
public:
PTYMultiplexer();
virtual ~PTYMultiplexer() override;
static PTYMultiplexer& the();
// ^CharacterDevice
virtual KResultOr<Retained<FileDescriptor>> open(int options) override;
virtual ssize_t read(Process&, byte*, ssize_t) override { return 0; }
virtual ssize_t write(Process&, const byte*, ssize_t) override { return 0; }
virtual bool can_read(Process&) const override { return true; }
virtual bool can_write(Process&) const override { return true; }
void notify_master_destroyed(Badge<MasterPTY>, unsigned index);
private:
// ^CharacterDevice
virtual const char* class_name() const override { return "PTYMultiplexer"; }
Lock m_lock;
Vector<unsigned> m_freelist;
};