CProcessStatisticsReader.h 588 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <AK/AKString.h>
  3. #include <AK/HashMap.h>
  4. struct CProcessStatistics {
  5. pid_t pid;
  6. unsigned nsched;
  7. String name;
  8. String state;
  9. String username;
  10. uid_t uid;
  11. String priority;
  12. size_t virtual_size;
  13. size_t physical_size;
  14. unsigned syscalls;
  15. };
  16. class CProcessStatisticsReader {
  17. public:
  18. CProcessStatisticsReader();
  19. HashMap<pid_t, CProcessStatistics> get_map();
  20. private:
  21. void update_map(HashMap<pid_t, CProcessStatistics>& map);
  22. String get_username_from_uid(const uid_t uid);
  23. HashMap<uid_t, String> m_usernames;
  24. };