summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2016-07-13 18:51:38 -0400
committerGitHub <noreply@github.com>2016-07-13 18:51:38 -0400
commitc93479bd7aa9aa7fa15af9a6d6aa7d24668a6e9a (patch)
treece3739ab6d10184599d80dcc6942644efaaa949d
parent1a685cb47e0335ff3f7cd577cb8f0ba6ccbb8947 (diff)
parent340f1b0b03cc03767ae0ea40c299ec708752b76c (diff)
downloadcoreclr-c93479bd7aa9aa7fa15af9a6d6aa7d24668a6e9a.tar.gz
coreclr-c93479bd7aa9aa7fa15af9a6d6aa7d24668a6e9a.tar.bz2
coreclr-c93479bd7aa9aa7fa15af9a6d6aa7d24668a6e9a.zip
Merge pull request #6205 from stephentoub/environmentaugments
Add EnvironmentAugments to coreclr
-rw-r--r--src/mscorlib/model.xml16
-rw-r--r--src/mscorlib/mscorlib.shared.sources.props3
-rw-r--r--src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs21
3 files changed, 40 insertions, 0 deletions
diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml
index 4b363a229d..b951881869 100644
--- a/src/mscorlib/model.xml
+++ b/src/mscorlib/model.xml
@@ -1847,6 +1847,22 @@
<Member Name="FailFast(System.String,System.Exception)" />
<Member Name="Exit(System.Int32)" />
</Type>
+ <Type Name="Internal.Runtime.Augments.EnvironmentAugments">
+ <Member MemberType="Property" Name="CurrentManagedThreadId" />
+ <Member MemberType="Property" Name="ExitCode" />
+ <Member MemberType="Property" Name="HasShutdownStarted" />
+ <Member MemberType="Property" Name="StackTrace" />
+ <Member MemberType="Property" Name="TickCount" />
+ <Member Name="get_CurrentManagedThreadId" />
+ <Member Name="get_ExitCode" />
+ <Member Name="set_ExitCode(System.Int32)" />
+ <Member Name="get_HasShutdownStarted" />
+ <Member Name="get_StackTrace" />
+ <Member Name="get_TickCount" />
+ <Member Name="Exit(System.Int32)" />
+ <Member Name="FailFast(System.String,System.Exception)" />
+ <Member Name="GetCommandLineArgs" />
+ </Type>
<Type Name="System.EventArgs">
<Member MemberType="Field" Name="Empty" />
<Member Name="#ctor" />
diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props
index 78983c0639..eed8917cd1 100644
--- a/src/mscorlib/mscorlib.shared.sources.props
+++ b/src/mscorlib/mscorlib.shared.sources.props
@@ -451,6 +451,9 @@
<SystemSources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\OleAutBinder.cs" />
</ItemGroup>
<ItemGroup>
+ <SystemSources Condition="'$(FeatureCoreclr)' == 'true'" Include="$(BclSourcesRoot)\Internal\Runtime\Augments\EnvironmentAugments.cs" />
+ </ItemGroup>
+ <ItemGroup>
<ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\__Filters.cs" />
<ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AmbiguousMatchException.cs" />
<ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Assembly.cs" />
diff --git a/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
new file mode 100644
index 0000000000..28104683c7
--- /dev/null
+++ b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace Internal.Runtime.Augments
+{
+ /// <summary>For internal use only. Exposes runtime functionality to the Environments implementation in corefx.</summary>
+ public static class EnvironmentAugments
+ {
+ public static int CurrentManagedThreadId => Environment.CurrentManagedThreadId;
+ public static void Exit(int exitCode) => Environment.Exit(exitCode);
+ public static int ExitCode { get { return Environment.ExitCode; } set { Environment.ExitCode = value; } }
+ public static void FailFast(string message, Exception error) => Environment.FailFast(message, error);
+ public static string[] GetCommandLineArgs() => Environment.GetCommandLineArgs();
+ public static bool HasShutdownStarted => Environment.HasShutdownStarted;
+ public static string StackTrace => Environment.StackTrace;
+ public static int TickCount => Environment.TickCount;
+ }
+}