From de7f0154429b517e45ac9a0684ad3eb5df252e06 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Tue, 17 Mar 2020 14:44:57 -0700 Subject: [PATCH] Remove mono lib (#118) * Remove mono lib * formatting --- src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj | 1 - src/Microsoft.Tye.Core/ProcessUtil.cs | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj b/src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj index 69963dc5..37ded46a 100644 --- a/src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj +++ b/src/Microsoft.Tye.Core/Microsoft.Tye.Core.csproj @@ -12,7 +12,6 @@ - diff --git a/src/Microsoft.Tye.Core/ProcessUtil.cs b/src/Microsoft.Tye.Core/ProcessUtil.cs index 3121a755..78f553b6 100644 --- a/src/Microsoft.Tye.Core/ProcessUtil.cs +++ b/src/Microsoft.Tye.Core/ProcessUtil.cs @@ -9,12 +9,14 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; -using Mono.Unix.Native; namespace Microsoft.Tye { public static class ProcessUtil { + [DllImport("libc", SetLastError = true, EntryPoint = "kill")] + private static extern int sys_kill(int pid, int sig); + public static async Task RunAsync( string filename, string arguments, @@ -119,7 +121,7 @@ namespace Microsoft.Tye { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - Syscall.kill(process.Id, Signum.SIGINT); + sys_kill(process.Id, sig: 2); // SIGINT var cancel = new CancellationTokenSource();