Update for WSL1 (#5592)

This commit is contained in:
Rich Lander 2020-11-12 16:48:55 -08:00 committed by GitHub
parent c5c177d22c
commit fb5309ed7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View file

@ -21,7 +21,9 @@ WriteLine($"{nameof(RuntimeInformation.OSArchitecture)}: {RuntimeInformation.OSA
WriteLine($"{nameof(Environment.ProcessorCount)}: {Environment.ProcessorCount}");
WriteLine();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Directory.Exists("/sys/fs/cgroup"))
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) &&
Directory.Exists("/sys/fs/cgroup/cpu") &&
Directory.Exists("/sys/fs/cgroup/memory"))
{
WriteLine("**CGroup info");
WriteLine($"cfs_quota_us: {ReadAllLines("/sys/fs/cgroup/cpu/cpu.cfs_quota_us")[0]}");

View file

@ -7,7 +7,7 @@
<LangVersion>9</LangVersion>
<Nullable>enable</Nullable>
<RollForward>LatestMajor</RollForward>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<PackageProjectUrl>https://github.com/dotnet/core/blob/master/samples/dotnet-runtimeinfo/README.md</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>.NET Foundation</Copyright>
@ -15,9 +15,4 @@
<PackAsTool>true</PackAsTool>
</PropertyGroup>
<!--
To pack correctly
dotnet pack /p:ContinuousIntegrationBuild=true
-->
</Project>