Expose remaining Environment.* public surface area from System.Private.Corelib#6006
Expose remaining Environment.* public surface area from System.Private.Corelib#6006stephentoub wants to merge 1 commit into
Conversation
| // 64-bit programs run only on 64-bit | ||
| return true; | ||
| #elif PLATFORM_UNIX | ||
| return IntPtr.Size == 8; // TODO: use uname and match utsname.machine? |
There was a problem hiding this comment.
We made simplifying assumption that OS architecture == Process architecture in System.Runtime.InteropServices.RuntimeInformation:
The same simplifying assumption should apply here.
There was a problem hiding this comment.
The same simplifying assumption should apply here
Meaning Is64BitProcess should always equal Is64BitOperatingSystem, both of which should be true iff BIT64 is set, and both of which should be true iff IntPtr.Size == 8?
|
|
| <Member Name="get_Is64BitOperatingSystem" /> | ||
| <Member Name="get_MachineName" /> | ||
| <Member Name="get_NewLine" /> | ||
| <Member Name="get_OSVersion" /> |
There was a problem hiding this comment.
Any ideas what OSVersion returns for non-windows?
There was a problem hiding this comment.
@weshaggard: It breaks with error message OSVersion's call to GetVersionEx failed., because an attempt is made to call Windows API functions:
This will need to be synthetized from GetCommandLineArgs() to get the subset of the command line passed in by the CoreCLR host, even on Windows. Mono has some code for it already: https://github.com/mono/mono/blob/master/mcs/class/corlib/System/Environment.cs#L128 |
|
I'm going to close this and put up a PR instead to add Environment to CoreFx. Then I'll submit PRs to add an EnvironmentAugments class to CoreCLR and CoreRT that can be used by that type. |
|
The EnvironmentAugments PR is in #6205. |
Known issues to address subsequently (I'll open issues for them):
cc: @jkotas, @danmosemsft, @weshaggard