Micro Focus recommends the use of cobgetfuncaddr()
to load shared objects.
I would prefer to use dlopen()
, but I don't want to risk missing out on side effects of cobgetfuncaddr()
that are not provided by dlopen()
.
I prefer dlopen() because it can load a shared object with many entry points.
Also, the error reporting on cobgetfuncaddr()
is weird:
You can call it in two modes:
1) When an error occurs you get a function pointer to a function that prints an error message.
2) When an error occurs it returns a NULL with no indication of the exact problem.
With dlopen()
/dlsym()
I can get detailed information on the problem.
Is there anything I need to do to safely use dlopen()
rather than coberrfuncaddr()
?
BTW: Testing indicates it works fine, but I don't code against tests, I code against doc. If the doc and tests disagree, then I report a bug.