From: Jim Warner Date: Thu, 6 Jun 2013 05:00:00 +0000 (-0500) Subject: top: add the major version to dlopen of libnuma soname X-Git-Tag: v3.3.9~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b55f9b97db9101e8fb1903d03f7bc7e9c8476572;p=procps-ng top: add the major version to dlopen of libnuma soname When the plug-in approach to NUMA support was added, I carelessly employed the compile-time linker convention for naming the library. Technically this then required the 'devel' package for NUMA support to be present for the unqualified soname symlink to be available. Either that or one must have manually created such a symlink. This commit adds the missing major version to dlopen() of libnuma.so.1 so simply having a more likely package such as 'numactl' will enable both '2' & '3' commands. References(s): http://www.freelists.org/post/procps/top-NUMA-node-CPU-utilization-support,25 . initial dlopen support commit edba932a7e9b950dd91bc486e107788e977a5186 Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 2b05a601..0d7ee2d4 100644 --- a/top/top.c +++ b/top/top.c @@ -3246,7 +3246,7 @@ static void before (char *me) { #if defined(PRETEND_NUMA) || defined(PRETEND8CPUS) Numa_node_tot = Numa_max_node() + 1; #else - Libnuma_handle = dlopen("libnuma.so", RTLD_LAZY); + Libnuma_handle = dlopen("libnuma.so.1", RTLD_LAZY); if (Libnuma_handle) { Numa_max_node = dlsym(Libnuma_handle, "numa_max_node"); Numa_node_of_cpu = dlsym(Libnuma_handle, "numa_node_of_cpu");