Project

General

Profile

Bug #2663 » test.c

shamaz, 04/15/2014 09:07 AM

 
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
printf ("testing %s\n", argv[1]);
void *handle = dlopen (argv[1], RTLD_NOW|RTLD_GLOBAL);
if (handle == NULL)
{
fprintf (stderr, "Cannot open the library\n");
exit(1);
}
int res = dlclose(handle);
if (res == -1) printf ("dclose returned an error");
void *handle2 = dlopen (argv[1], RTLD_NOW|RTLD_GLOBAL);
return 0;
}
(1-1/2)