Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27821d81 authored by T.J. Mercier's avatar T.J. Mercier
Browse files

libprocessgroup: Remove getAttributePathForTask

getAttributePathForTask has always directly called
CgroupGetAttributePathForTask, and there is no reason for callers not to
use CgroupGetAttributePathForTask.

Change-Id: Id1533fc0d9ecec96dacb5ebf0f32b799660fbf88
parent 1de1f1d8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ bool CgroupsAvailable();
bool CgroupGetControllerPath(const std::string& cgroup_name, std::string* path);
bool CgroupGetControllerFromPath(const std::string& path, std::string* cgroup_name);
bool CgroupGetAttributePath(const std::string& attr_name, std::string* path);
// Provides the path for an attribute in a specific process group
// Returns false in case of error, true in case of success
bool CgroupGetAttributePathForTask(const std::string& attr_name, pid_t tid, std::string* path);

bool SetTaskProfiles(pid_t tid, const std::vector<std::string>& profiles,
@@ -81,10 +83,6 @@ bool setProcessGroupLimit(uid_t uid, pid_t initialPid, int64_t limitInBytes);

void removeAllEmptyProcessGroups(void);

// Provides the path for an attribute in a specific process group
// Returns false in case of error, true in case of success
bool getAttributePathForTask(const std::string& attr_name, pid_t tid, std::string* path);

// Check if a profile can be applied without failing.
// Returns true if it can be applied without failing, false otherwise
bool isProfileValidForProcess(const std::string& profile_name, uid_t uid, pid_t pid);
+0 −4
Original line number Diff line number Diff line
@@ -746,10 +746,6 @@ bool setProcessGroupLimit(uid_t, pid_t pid, int64_t limit_in_bytes) {
    return SetProcessGroupValue(pid, "MemLimit", limit_in_bytes);
}

bool getAttributePathForTask(const std::string& attr_name, pid_t tid, std::string* path) {
    return CgroupGetAttributePathForTask(attr_name, tid, path);
}

bool isProfileValidForProcess(const std::string& profile_name, uid_t uid, pid_t pid) {
    const TaskProfile* tp = TaskProfiles::GetInstance().GetProfile(profile_name);