mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
Userland+LibCore: Use CProcessStatisticsReader to implement top.
Also tweaked CProcessStatisticsReader a bit to simplify the API.
This commit is contained in:
parent
7083a0104a
commit
01216f3c3f
5 changed files with 52 additions and 72 deletions
|
@ -18,12 +18,9 @@ struct CProcessStatistics {
|
|||
|
||||
class CProcessStatisticsReader {
|
||||
public:
|
||||
CProcessStatisticsReader();
|
||||
HashMap<pid_t, CProcessStatistics> get_map();
|
||||
static HashMap<pid_t, CProcessStatistics> get_all();
|
||||
|
||||
private:
|
||||
void update_map(HashMap<pid_t, CProcessStatistics>& map);
|
||||
String get_username_from_uid(const uid_t uid);
|
||||
|
||||
HashMap<uid_t, String> m_usernames;
|
||||
static String username_from_uid(uid_t);
|
||||
static HashMap<uid_t, String> s_usernames;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue