38 #include <sys/types.h>
47 int main(
int argc,
char **argv)
50 void* (*kingcobra_function)(
void*);
57 handle = dlopen(
"/home/kashrinivaasan/linux-3.7.8/drivers/virgo/queuing/libkingcobra_commands.so", RTLD_LAZY);
59 fprintf(stderr,
"%s\n", dlerror());
65 printf(
"dlsym lookup for kingcobra function: %s\n", argv[1]);
66 *(
void **) (&kingcobra_function) = dlsym(handle, argv[1]);
69 if ((error = dlerror()) != NULL) {
70 fprintf(stderr,
"%s\n", error);
73 printf(
"KingCobra userspace library: spawning userspace thread for KingCobra function pointer: %x\n",kingcobra_function);
75 s=pthread_create(&tid, NULL, kingcobra_function, &args);
76 pthread_join(tid, &x);