1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibCore: Make ProcessStatisticsReader return results in a Vector

The HashMap API was overkill and made using this less ergonomic than
it should be.
This commit is contained in:
Andreas Kling 2021-05-23 11:08:32 +02:00
parent a345a1f4a1
commit a1e133cc6b
12 changed files with 79 additions and 83 deletions

View file

@ -1,12 +1,11 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <AK/String.h>
#include <LibCore/File.h>
#include <unistd.h>
@ -67,8 +66,8 @@ struct ProcessStatistics {
class ProcessStatisticsReader {
public:
static Optional<HashMap<pid_t, Core::ProcessStatistics>> get_all(RefPtr<Core::File>&);
static Optional<HashMap<pid_t, Core::ProcessStatistics>> get_all();
static Optional<Vector<Core::ProcessStatistics>> get_all(RefPtr<Core::File>&);
static Optional<Vector<Core::ProcessStatistics>> get_all();
private:
static String username_from_uid(uid_t);