Kernel: Add procfs that contains only pids
This commit is contained in:
26
kernel/include/kernel/FS/ProcFS/FileSystem.h
Normal file
26
kernel/include/kernel/FS/ProcFS/FileSystem.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/FS/RamFS/FileSystem.h>
|
||||
#include <kernel/FS/RamFS/Inode.h>
|
||||
#include <kernel/Process.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
class ProcFileSystem final : public RamFileSystem
|
||||
{
|
||||
public:
|
||||
static void initialize();
|
||||
static ProcFileSystem& get();
|
||||
|
||||
BAN::ErrorOr<void> on_process_create(Process&);
|
||||
void on_process_delete(Process&);
|
||||
|
||||
private:
|
||||
ProcFileSystem(size_t size);
|
||||
|
||||
private:
|
||||
BAN::RefPtr<RamDirectoryInode> m_root_inode;
|
||||
};
|
||||
|
||||
}
|
||||
23
kernel/include/kernel/FS/ProcFS/Inode.h
Normal file
23
kernel/include/kernel/FS/ProcFS/Inode.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/FS/RamFS/FileSystem.h>
|
||||
#include <kernel/FS/RamFS/Inode.h>
|
||||
#include <kernel/Process.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
class ProcPidInode final : public RamDirectoryInode
|
||||
{
|
||||
public:
|
||||
static BAN::ErrorOr<BAN::RefPtr<ProcPidInode>> create(Process&, RamFileSystem&, mode_t, uid_t, gid_t);
|
||||
~ProcPidInode() = default;
|
||||
|
||||
private:
|
||||
ProcPidInode(Process&, RamFileSystem&, const FullInodeInfo&);
|
||||
|
||||
private:
|
||||
Process& m_process;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user