-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use separate partials for iOS&tvOS instead of UnknowUnix in System.Di…
…agnostics.Process (#61871)
- Loading branch information
1 parent
bf1797a
commit 8997e86
Showing
8 changed files
with
192 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.iOS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.Versioning; | ||
|
||
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> | ||
[UnsupportedOSPlatform("ios")] | ||
[UnsupportedOSPlatform("tvos")] | ||
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 ProcessModuleCollection GetModules(int processId) | ||
{ | ||
return new ProcessModuleCollection(0); | ||
} | ||
|
||
private static ProcessInfo CreateProcessInfo(int pid) | ||
{ | ||
throw new PlatformNotSupportedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.iOS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.Versioning; | ||
|
||
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> | ||
[UnsupportedOSPlatform("ios")] | ||
[UnsupportedOSPlatform("tvos")] | ||
public TimeSpan PrivilegedProcessorTime | ||
{ | ||
get { throw new PlatformNotSupportedException(); } | ||
} | ||
|
||
private DateTime GetStartTime() => 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> | ||
[UnsupportedOSPlatform("ios")] | ||
[UnsupportedOSPlatform("tvos")] | ||
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> | ||
[UnsupportedOSPlatform("ios")] | ||
[UnsupportedOSPlatform("tvos")] | ||
public TimeSpan UserProcessorTime | ||
{ | ||
get { throw new PlatformNotSupportedException(); } | ||
} | ||
} | ||
} |