22 #include <sys/types.h>
32 int main(
int argc,
char **argv)
35 void* (*cloud_function)(
void*);
42 handle = dlopen(
"/home/kashrinivaasan/linux-3.7.8/drivers/virgo/cloudfs/libvirgo_fs.so", RTLD_LAZY);
44 fprintf(stderr,
"%s\n", dlerror());
50 printf(
"dlsym lookup for cloud fs function: %s\n", argv[1]);
51 char* symbol_args=strdup(argv[1]);
52 char* symbol=strsep(&symbol_args,
" ");
53 printf(
"virgo_kernel_upcall_plugin: symbol=%s, symbol_args=%s\n",symbol,symbol_args);
54 *(
void **) (&cloud_function) = dlsym(handle, symbol);
57 if ((error = dlerror()) != NULL) {
58 fprintf(stderr,
"%s\n", error);
61 printf(
"virgo_kernel_upcall_plugin: spawning userspace thread for virgo cloud fs function pointer: %x\n",cloud_function);
62 s=pthread_create(&tid, NULL, cloud_function, symbol_args);
63 pthread_join(tid, &x);