2018-10-23 11:57:38 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
#include <VirtualFileSystem/SyntheticFileSystem.h>
|
|
|
|
|
|
2018-11-01 13:15:46 +01:00
|
|
|
class Process;
|
2018-10-26 17:42:12 +02:00
|
|
|
|
2018-10-23 11:57:38 +02:00
|
|
|
class ProcFileSystem final : public SyntheticFileSystem {
|
|
|
|
|
public:
|
2018-10-26 18:43:25 +02:00
|
|
|
static ProcFileSystem& the() PURE;
|
2018-10-26 17:42:12 +02:00
|
|
|
|
2018-10-23 11:57:38 +02:00
|
|
|
virtual ~ProcFileSystem() override;
|
|
|
|
|
static RetainPtr<ProcFileSystem> create();
|
|
|
|
|
|
|
|
|
|
virtual bool initialize() override;
|
2018-11-15 15:36:35 +01:00
|
|
|
virtual const char* class_name() const override;
|
2018-10-23 11:57:38 +02:00
|
|
|
|
2018-11-01 13:15:46 +01:00
|
|
|
void addProcess(Process&);
|
|
|
|
|
void removeProcess(Process&);
|
2018-10-26 17:42:12 +02:00
|
|
|
|
2018-10-23 11:57:38 +02:00
|
|
|
private:
|
|
|
|
|
ProcFileSystem();
|
2018-10-26 17:42:12 +02:00
|
|
|
|
|
|
|
|
HashMap<pid_t, InodeIndex> m_pid2inode;
|
2018-10-23 11:57:38 +02:00
|
|
|
};
|
|
|
|
|
|