Skip to content

Exclude all cgroup.cpp variants from build on non-linux Unix OSes. #99363

Closed

Description

@janvorli

@ivanpovazan have made me aware today of the fact that we build and link cgroup.cpp variants and cgroupcpu.cpp macOS. Even though it doesn't cause any harm execution-wise, it is unused on it (we just effectively call statfs on "/sys/fs/cgroup" to check for the filesystem magic and return false since no cgroup filesystem is mounted there), there is no sense in having the code in.

We should still compile / link the code, but ifdef out everything that is trying to access cgroups. Only keep functions GetPhysicalMemoryUsed / GetRestrictedPhysicalMemoryLimit / PAL_GetCpuLimit / GetCpuLimit that it makes sense to preserve as they either have an implementation that contains non-cgroup fallback or might get one in the future.

Activity

  1. added
    area-PAL-coreclr
    on Mar 6, 2024
  2. added this to the 9.0.0 milestone on Mar 6, 2024
  3. ivanpovazan commented on Mar 6, 2024

    @ivanpovazan
    Member
  4. modified the milestones: 9.0.0, 10.0.0 on Jul 22, 2024
  5. janvorli commented on Jul 22, 2024

    @janvorli
    MemberAuthor

    Moving to 10.0 as it is not critical and we have more pressing issues to fix for 9.

  6. modified the milestones: 10.0.0, Future on Jul 7, 2025
  7. added and removed
    area-PAL-coreclr
    on Apr 9, 2026
  8. dotnet-policy-service commented on Apr 9, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke
    See info in area-owners.md if you want to be subscribed.

  9. locked and limited conversation to collaborators on May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions