Merge changes from topic "cgroup abstraction layer"

am: faa6c4894d

Change-Id: I0d545daaaa0a20dd2e605f1a4be9a1ae9e3f02d6
This commit is contained in:
Suren Baghdasaryan 2019-02-03 20:19:26 -08:00 committed by android-build-merger
commit e419456f89

View file

@ -142,6 +142,9 @@ static bool ReadDescriptors(std::map<std::string, CgroupDescriptor>* descriptors
return true;
}
// To avoid issues in sdk_mac build
#if defined(__ANDROID__)
static bool SetupCgroup(const CgroupDescriptor& descriptor) {
const CgroupController* controller = descriptor.controller();
@ -180,6 +183,15 @@ static bool SetupCgroup(const CgroupDescriptor& descriptor) {
return true;
}
#else
// Stubs for non-Android targets.
static bool SetupCgroup(const CgroupDescriptor&) {
return false;
}
#endif
static bool WriteRcFile(const std::map<std::string, CgroupDescriptor>& descriptors) {
std::string cgroup_rc_path = StringPrintf("%s/%s", CGROUPS_RC_DIR, CgroupMap::CGROUPS_RC_FILE);
unique_fd fd(TEMP_FAILURE_RETRY(open(cgroup_rc_path.c_str(),