30 #include <sys/ioctl.h>
31 #include <sys/types.h>
35 #define _NETINT_LIBXCODER_DYNAMIC_LOADING_TEST_
38 int main(
int argc,
char **argv)
44 int failed_func_ptr_check = 0;
46 handle = dlopen (
"libxcoder.so", RTLD_NOW);
48 fprintf(stderr,
"%s\n", dlerror());
60 if ((error = dlerror()) != NULL) {
61 fprintf(stderr,
"%s\n", error);
64 printf(
"Dynamically loaded functionList\n");
67 sizeof(
void *))); i++)
69 if (((
void *) *(((
void **) &functionList) + i)) == NULL)
71 fprintf(stderr,
"Failed to load function pointer at function %d in "
72 "NETINT_LIBXCODER_API_FUNCTION_LIST\n", i);
73 failed_func_ptr_check = 1;
77 if (!failed_func_ptr_check)
79 printf(
"All functions in functionList were loaded.\nPass\n");
83 exit(failed_func_ptr_check);