From 73ab9be25b8e3366f9bdf13ec023a1355206a004 Mon Sep 17 00:00:00 2001 From: Peter Rekdal Khan-Sunde Date: Thu, 15 Sep 2022 10:54:58 +0200 Subject: [PATCH] Bugfix: When loading a library via dlopen using a name, a SONAME of that library should be used. --- src/Snap/CoreRunLib.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Snap/CoreRunLib.cs b/src/Snap/CoreRunLib.cs index 767e16ab..8788177a 100644 --- a/src/Snap/CoreRunLib.cs +++ b/src/Snap/CoreRunLib.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Runtime.InteropServices; using Snap.Core; @@ -210,13 +210,13 @@ public override bool Equals(object obj) public static bool operator !=(pid_t v1, pid_t v2) => v1.Value != v2.Value; } - [DllImport("libdl", SetLastError = true, EntryPoint = "dlsym", CharSet = CharSet.Ansi)] + [DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlsym", CharSet = CharSet.Ansi)] public static extern IntPtr dlsym(IntPtr handle, string symbol); - [DllImport("libdl", SetLastError = true, EntryPoint = "dlopen", CharSet = CharSet.Ansi)] + [DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlopen", CharSet = CharSet.Ansi)] public static extern IntPtr dlopen(string filename, int flags); - [DllImport("libdl", SetLastError = true, EntryPoint = "dlclose")] + [DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlclose")] public static extern int dlclose(IntPtr hModule); - [DllImport("libc", SetLastError = true, EntryPoint = "kill")] + [DllImport("libdl.so.2", SetLastError = true, EntryPoint = "kill")] public static extern int kill (pid_t pid, int sig); }