2019-01-29 21:49:20 -02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
2019-04-03 07:25:24 -03:00
|
|
|
#include <Kernel/FileSystem/SyntheticFileSystem.h>
|
2019-01-29 21:49:20 -02:00
|
|
|
|
|
|
|
|
class Process;
|
2019-01-30 15:26:19 -02:00
|
|
|
class SlavePTY;
|
2019-01-29 21:49:20 -02:00
|
|
|
|
|
|
|
|
class DevPtsFS final : public SynthFS {
|
|
|
|
|
public:
|
2019-02-15 09:30:48 -02:00
|
|
|
[[gnu::pure]] static DevPtsFS& the();
|
2019-01-29 21:49:20 -02:00
|
|
|
|
|
|
|
|
virtual ~DevPtsFS() override;
|
2019-02-25 08:43:52 -03:00
|
|
|
static Retained<DevPtsFS> create();
|
2019-01-29 21:49:20 -02:00
|
|
|
|
|
|
|
|
virtual bool initialize() override;
|
|
|
|
|
virtual const char* class_name() const override;
|
|
|
|
|
|
|
|
|
|
void register_slave_pty(SlavePTY&);
|
|
|
|
|
void unregister_slave_pty(SlavePTY&);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DevPtsFS();
|
|
|
|
|
|
2019-02-25 08:43:52 -03:00
|
|
|
Retained<SynthFSInode> create_slave_pty_device_file(unsigned index);
|
2019-01-29 21:49:20 -02:00
|
|
|
|
|
|
|
|
HashTable<SlavePTY*> m_slave_ptys;
|
|
|
|
|
};
|
|
|
|
|
|