Below is a little snipper that tries to dlopen(argv[1]).
It works fine until it is compiled with profiling support, -pg flag.
Compiled with -pg, dlopen() reports "Service unavailable".
How to fix that ?
-sergey
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
void *handle, *sym;
if (argc > 1) {
handle = dlopen(argv[1], RTLD_NOW);
if (handle == NULL) {
fprintf(stderr, "dlopen: %s\n", dlerror());
} else {
fprintf(stderr, "handle: %p\n", handle);
if (argc > 2) {
sym = dlsym(handle, argv[2]);
fprintf(stderr, "%s: %p\n", argv[2], sym);
}
}
}
return (EXIT_SUCCESS);
}
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"