ladybird/Libraries/LibCore/CProcessStatisticsReader.h
Andreas Kling 01216f3c3f Userland+LibCore: Use CProcessStatisticsReader to implement top.
Also tweaked CProcessStatisticsReader a bit to simplify the API.
2019-07-10 13:56:28 +02:00

27 lines
500 B
C++

#pragma once
#include <AK/AKString.h>
#include <AK/HashMap.h>
struct CProcessStatistics {
pid_t pid;
unsigned nsched;
String name;
String state;
String username;
uid_t uid;
String priority;
size_t virtual_size;
size_t physical_size;
unsigned syscalls;
};
class CProcessStatisticsReader {
public:
static HashMap<pid_t, CProcessStatistics> get_all();
private:
static String username_from_uid(uid_t);
static HashMap<uid_t, String> s_usernames;
};