mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
b4e478aa50
This required a fair bit of plumbing. The CharacterDevice::close() virtual will now be closed by ~FileDescriptor(), allowing device implementations to do custom cleanup at that point. One big problem remains: if the master PTY is closed before the slave PTY, we go into crashy land.
29 lines
588 B
C++
29 lines
588 B
C++
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <Kernel/SyntheticFileSystem.h>
|
|
|
|
class Process;
|
|
class SlavePTY;
|
|
|
|
class DevPtsFS final : public SynthFS {
|
|
public:
|
|
static DevPtsFS& the() PURE;
|
|
|
|
virtual ~DevPtsFS() override;
|
|
static RetainPtr<DevPtsFS> create();
|
|
|
|
virtual bool initialize() override;
|
|
virtual const char* class_name() const override;
|
|
|
|
void register_slave_pty(SlavePTY&);
|
|
void unregister_slave_pty(SlavePTY&);
|
|
|
|
private:
|
|
DevPtsFS();
|
|
|
|
RetainPtr<SynthFSInode> create_slave_pty_device_file(unsigned index);
|
|
|
|
HashTable<SlavePTY*> m_slave_ptys;
|
|
};
|
|
|