Displaying 5 results from an estimated 5 matches for "orig_dlopen".
2020 Feb 16
0
[nbdkit PATCH v4 1/4] server: Export nbdkit_set_dlopen_prefix function
...main nbdkit executable prior to the
+ * library providing the real dlopen (libdl on Linux, libc on BSD).
+ */
+
+#include <config.h>
+
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "internal.h"
+
+static void *(*orig_dlopen) (const char *filename, int flags);
+
+/* NULL for normal behavior, or set when we want to override
+ * relative dlopen()s to instead be an absolute open with prefix.
+ */
+static char *dir;
+
+int
+nbdkit_set_dlopen_prefix (const char *newdir)
+{
+ free (dir);
+ if (newdir) {
+ dir = strdup (...
2020 Feb 13
4
[PATCH nbdkit v2 2/3] NOT WORKING: vddk: Drive library loading from libdir parameter.
I couldn't get this to work in the end. This is the latest
non-working version. This email documents what doesn't work for the
permanent record.
The central problem is that VDDK InitEx() appears to dlopen() various
of its own plugins. Although I wasn't able to capture exactly what
dlopen() command it is running, the plugins cannot be loaded because
they rely on the recompiled
2020 Feb 13
1
[nbdkit PATCH v3] vddk: Drive library loading from libdir parameter.
...* loaded in the same namespace; but because it is in a new namespace,
+ * it cannot use exported nbdkit functions from the main namespace.
+ */
+
+#include <config.h>
+
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void *(*orig_dlopen) (const char *filename, int flags);
+
+/* NULL for normal behavior, or set when we want to override
+ * relative dlopen()s to instead be an absolute open with prefix.
+ */
+static char *dir;
+
+int nbdkit_set_dlopen_prefix (const char *newdir)
+{
+ free (dir);
+ if (newdir) {
+ dir = strdup (n...
2020 Feb 17
5
[nbdkit PATCH v5 0/4] vddk: Drive library loading from libdir parameter.
Differences from v4:
Patch 1 is simplified: I realized that since we already use -rdynamic
for nbdkit (after all, we WANT our dlopen()d plugins to be able to
call our nbdkit_* exports), it is only a matter of adding dlopen to
the set of symbols that we export. With that done, there is no
separate shared library needed; our dlopen shim is now part of nbdkit
proper, and we don't have to tweak
2020 Feb 16
6
[nbdkit PATCH v4 0/4] vddk: Drive library loading from libdir parameter.
I'm a lot happier with this version: no mucking with dlmopen(). It
does add a bit more coupling between nbdkit proper and the vddk plugin
(namely, nbdkit now exports a new function that the vddk plugin relies
on), but patch 2 adds testsuite coverage of the new function so we
shouldn't regress.
Patch 1 and 2 are new, patch 3 is unchanged from when Rich posted it
in v2, and patch 4 is