mirror of
https://github.com/termux/termux-packages.git
synced 2024-11-27 06:18:57 +00:00
64 lines
2.0 KiB
Diff
64 lines
2.0 KiB
Diff
--- ./libcontainer/cgroups/fs/cpuset.go.orig 2020-01-22 17:19:15.000000000 +0100
|
|
+++ ./libcontainer/cgroups/fs/cpuset.go 2020-02-22 21:17:22.474879849 +0100
|
|
@@ -26,12 +26,12 @@
|
|
|
|
func (s *CpusetGroup) Set(path string, r *configs.Resources) error {
|
|
if r.CpusetCpus != "" {
|
|
- if err := cgroups.WriteFile(path, "cpuset.cpus", r.CpusetCpus); err != nil {
|
|
+ if err := cgroups.WriteFile(path, "cpus", r.CpusetCpus); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if r.CpusetMems != "" {
|
|
- if err := cgroups.WriteFile(path, "cpuset.mems", r.CpusetMems); err != nil {
|
|
+ if err := cgroups.WriteFile(path, "mems", r.CpusetMems); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
@@ -83,7 +83,7 @@
|
|
func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error {
|
|
var err error
|
|
|
|
- stats.CPUSetStats.CPUs, err = getCpusetStat(path, "cpuset.cpus")
|
|
+ stats.CPUSetStats.CPUs, err = getCpusetStat(path, "cpus")
|
|
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
|
return err
|
|
}
|
|
@@ -93,7 +93,7 @@
|
|
return err
|
|
}
|
|
|
|
- stats.CPUSetStats.Mems, err = getCpusetStat(path, "cpuset.mems")
|
|
+ stats.CPUSetStats.Mems, err = getCpusetStat(path, "mems")
|
|
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
|
return err
|
|
}
|
|
@@ -172,10 +172,10 @@
|
|
}
|
|
|
|
func getCpusetSubsystemSettings(parent string) (cpus, mems string, err error) {
|
|
- if cpus, err = cgroups.ReadFile(parent, "cpuset.cpus"); err != nil {
|
|
+ if cpus, err = cgroups.ReadFile(parent, "cpus"); err != nil {
|
|
return
|
|
}
|
|
- if mems, err = cgroups.ReadFile(parent, "cpuset.mems"); err != nil {
|
|
+ if mems, err = cgroups.ReadFile(parent, "mems"); err != nil {
|
|
return
|
|
}
|
|
return cpus, mems, nil
|
|
@@ -221,12 +221,12 @@
|
|
}
|
|
|
|
if isEmptyCpuset(currentCpus) {
|
|
- if err := cgroups.WriteFile(current, "cpuset.cpus", parentCpus); err != nil {
|
|
+ if err := cgroups.WriteFile(current, "cpus", parentCpus); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if isEmptyCpuset(currentMems) {
|
|
- if err := cgroups.WriteFile(current, "cpuset.mems", parentMems); err != nil {
|
|
+ if err := cgroups.WriteFile(current, "mems", parentMems); err != nil {
|
|
return err
|
|
}
|
|
}
|