From 6e5845e3afa2326944fddde1de244a6515bb8ad5 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Mon, 15 Nov 2021 22:03:59 +0300 Subject: [PATCH] Exclude the managed code around libproc on iOS/tvOS (#61590) Since libproc is a private Apple API, it is not available on iOS/tvOS and should be excluded (see #61265 (comment) and above for more details). This PR excludes $(CommonPath)Interop\OSX\Interop.libproc.cs on the iOS/tvOS as well as makes some methods in Process, ProcessManager, and ProcessThread classes calling that API throw PNSE so that for iOS/tvOS it's possible to re-use the respective *.UnknownUnix.cs parts. --- .../src/System.Diagnostics.Process.csproj | 6 +++--- .../src/System/Diagnostics/Process.UnknownUnix.cs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index 1bf0c43270e42..a47851bff81cb 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -5,7 +5,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS enable - $(NoWarn);0649 + $(NoWarn);0649 SR.Process_PlatformNotSupported @@ -309,7 +309,7 @@ - + @@ -345,7 +345,7 @@ - + diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs index 46c652a7fb6a6..897fde77e9a75 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs @@ -9,7 +9,7 @@ public partial class Process : IDisposable /// Creates an array of components that are associated with process resources on a /// remote computer. These process resources share the specified process name. /// - public static Process[] GetProcessesByName(string processName, string machineName) + public static Process[] GetProcessesByName(string? processName, string machineName) { throw new PlatformNotSupportedException(); } @@ -82,5 +82,6 @@ private string GetPathToOpenFile() throw new PlatformNotSupportedException(); } + private int ParentProcessId => throw new PlatformNotSupportedException(); } }