Back to index

glibc  2.9
unload6mod3.c
Go to the documentation of this file.
00001 #include <dlfcn.h>
00002 #include <stdio.h>
00003 #include <unistd.h>
00004 
00005 static void *h;
00006 
00007 static void __attribute__((constructor))
00008 mod3init (void)
00009 {
00010   h = dlopen ("unload6mod1.so", RTLD_LAZY);
00011   if (h == NULL)
00012     {
00013       puts ("dlopen unload6mod1.so failed");
00014       fflush (stdout);
00015       _exit (1);
00016     }
00017 }
00018 
00019 static void __attribute__((destructor))
00020 mod3fini (void)
00021 {
00022   dlclose (h);
00023 }