Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@
<!-- Set up common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsWindows Condition="'$(OSGroup)' == 'Windows_NT'">true</TargetsWindows>
<TargetsUnix Condition="'$(TargetsWindows)' != 'true'">true</TargetsUnix>

<TargetsLinux Condition="'$(OSGroup)' == 'Linux'">true</TargetsLinux>
<TargetsOSX Condition="'$(OSGroup)' == 'OSX'">true</TargetsOSX>
<TargetsFreeBSD Condition="'$(OSGroup)' == 'FreeBSD'">true</TargetsFreeBSD>

<TargetsUnix Condition="'$(TargetsLinux)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsFreeBSD)' == 'true'">true</TargetsUnix>
<TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(OSGroup)' != 'FreeBSD' AND '$(OSGroup)' != 'Linux' AND '$(OSGroup)' != 'OSX'">true</TargetsUnknownUnix>
</PropertyGroup>
<!-- Make some assumptions based on TargetsPlatform -->
<PropertyGroup Condition="'$(UseUnixPackageTargetRuntimeDefaults)' == 'true' OR '$(UsePackageTargetRuntimeDefaults)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<PackageTargetFramework>dotnet5.5</PackageTargetFramework>
<UsePackageTargetRuntimeDefaults>true</UsePackageTargetRuntimeDefaults>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetsFreeBSD)' == 'true' OR '$(TargetsUnknownUnix)' == 'true' ">
<!-- Suppress unused field warnings when using PlatformNotSupportedException stubs -->
<NoWarn>0649</NoWarn>
</PropertyGroup>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? Can you comment it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of fields that aren't being used. I'll add a comment.

<!-- Help VS understand available configurations -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Windows_Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Windows_Release|AnyCPU' " />
Expand Down Expand Up @@ -289,6 +293,11 @@
<Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(TargetsFreeBSD)' == 'true' OR '$(TargetsUnknownUnix)' == 'true' ">
<Compile Include="System\Diagnostics\Process.UnknownUnix.cs" />
<Compile Include="System\Diagnostics\ProcessManager.UnknownUnix.cs" />
<Compile Include="System\Diagnostics\ProcessThread.UnknownUnix.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Diagnostics
{
public partial class Process : IDisposable
{
/// <summary>
/// Creates an array of <see cref="Process"/> components that are associated with process resources on a
/// remote computer. These process resources share the specified process name.
/// </summary>
public static Process[] GetProcessesByName(string processName, string machineName)
{
throw new PlatformNotSupportedException();
}

/// <summary>Gets the amount of time the process has spent running code inside the operating system core.</summary>
public TimeSpan PrivilegedProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>Gets the time the associated process was started.</summary>
public DateTime StartTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Gets the amount of time the associated process has spent utilizing the CPU.
/// It is the sum of the <see cref='System.Diagnostics.Process.UserProcessorTime'/> and
/// <see cref='System.Diagnostics.Process.PrivilegedProcessorTime'/>.
/// </summary>
public TimeSpan TotalProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Gets the amount of time the associated process has spent running code
/// inside the application portion of the process (not the operating system core).
/// </summary>
public TimeSpan UserProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Gets or sets which processors the threads in this process can be scheduled to run on.
/// </summary>
private unsafe IntPtr ProcessorAffinityCore
{
get { throw new PlatformNotSupportedException(); }
set { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Make sure we have obtained the min and max working set limits.
/// </summary>
private void GetWorkingSetLimits(out IntPtr minWorkingSet, out IntPtr maxWorkingSet)
{
throw new PlatformNotSupportedException();
}

/// <summary>Sets one or both of the minimum and maximum working set limits.</summary>
/// <param name="newMin">The new minimum working set limit, or null not to change it.</param>
/// <param name="newMax">The new maximum working set limit, or null not to change it.</param>
/// <param name="resultingMin">The resulting minimum working set limit after any changes applied.</param>
/// <param name="resultingMax">The resulting maximum working set limit after any changes applied.</param>
private void SetWorkingSetLimitsCore(IntPtr? newMin, IntPtr? newMax, out IntPtr resultingMin, out IntPtr resultingMax)
{
throw new PlatformNotSupportedException();
}

private static string GetExePath()
{
throw new PlatformNotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Diagnostics
{
internal static partial class ProcessManager
{
/// <summary>Gets the IDs of all processes on the current machine.</summary>
public static int[] GetProcessIds()
{
throw new PlatformNotSupportedException();
}

/// <summary>Gets process infos for each process on the specified machine.</summary>
/// <param name="machineName">The target machine.</param>
/// <returns>An array of process infos, one per found process.</returns>
public static ProcessInfo[] GetProcessInfos(string machineName)
{
throw new PlatformNotSupportedException();
}

/// <summary>Gets an array of module infos for the specified process.</summary>
/// <param name="processId">The ID of the process whose modules should be enumerated.</param>
/// <returns>The array of modules.</returns>
internal static ModuleInfo[] GetModuleInfos(int processId)
{
return Array.Empty<ModuleInfo>();
}

private static ProcessInfo CreateProcessInfo(int pid)
{
throw new PlatformNotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Diagnostics
{
public partial class ProcessThread
{
/// <summary>
/// Returns or sets the priority level of the associated thread. The priority level is
/// not an absolute level, but instead contributes to the actual thread priority by
/// considering the priority class of the process.
/// </summary>
private ThreadPriorityLevel PriorityLevelCore
{
get { throw new PlatformNotSupportedException(); }
set { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Returns the amount of time the thread has spent running code inside the operating
/// system core.
/// </summary>
public TimeSpan PrivilegedProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>Returns the time the associated thread was started.</summary>
public DateTime StartTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Returns the amount of time the associated thread has spent utilizing the CPU.
/// It is the sum of the System.Diagnostics.ProcessThread.UserProcessorTime and
/// System.Diagnostics.ProcessThread.PrivilegedProcessorTime.
/// </summary>
public TimeSpan TotalProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}

/// <summary>
/// Returns the amount of time the associated thread has spent running code
/// inside the application (not the operating system core).
/// </summary>
public TimeSpan UserProcessorTime
{
get { throw new PlatformNotSupportedException(); }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
<Link>Common\Microsoft\Win32\SafeHandles\SafeEventStreamHandle.OSX.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(TargetsFreeBSD)' == 'true' OR '$(TargetsUnknownUnix)' == 'true' ">
<Compile Include="System\IO\FileSystemWatcher.UnknownUnix.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.IO
{
public partial class FileSystemWatcher
{
/// <summary>Called when FileSystemWatcher is finalized.</summary>
private void FinalizeDispose()
{
}

private void StartRaisingEvents()
{
throw new PlatformNotSupportedException();
}

private void StopRaisingEvents()
{
throw new PlatformNotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@
<Link>Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs</Link>
</Compile>
</ItemGroup>
<!-- Unknown Unix -->
<ItemGroup Condition=" '$(TargetsFreeBSD)' == 'true' OR '$(TargetsUnknownUnix)' == 'true' ">
<Compile Include="System\Net\NetworkInformation\IPGlobalPropertiesPal.UnknownUnix.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkInterfacePal.UnknownUnix.cs" />
<Compile Include="System\Net\NetworkInformation\NetworkAddressChange.UnknownUnix.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Net.NetworkInformation
{
internal static class IPGlobalPropertiesPal
{
public static IPGlobalProperties GetIPGlobalProperties()
{
throw new PlatformNotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Net.NetworkInformation
{
public class NetworkChange
{
public static event NetworkAddressChangedEventHandler NetworkAddressChanged
{
add { throw new PlatformNotSupportedException(); }
remove { throw new PlatformNotSupportedException(); }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Net.NetworkInformation
{
internal static class NetworkInterfacePal
{
/// Returns objects that describe the network interfaces on the local computer.
public static NetworkInterface[] GetAllNetworkInterfaces()
{
throw new PlatformNotSupportedException();
}

public static bool GetIsNetworkAvailable()
{
throw new PlatformNotSupportedException();
}

public static int IPv6LoopbackInterfaceIndex
{
get { throw new PlatformNotSupportedException(); }
}

public static int LoopbackInterfaceIndex
{
get { throw new PlatformNotSupportedException(); }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace System.Runtime.InteropServices
{
public static class RuntimeInformation
{
public static bool IsOSPlatform(OSPlatform osPlatform)
{
throw new PlatformNotSupportedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' ">
<Compile Include="RuntimeInformation.Windows.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnknownUnix)' == 'true' ">
<Compile Include="RuntimeInformation.UnknownUnix.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
Expand Down