Back to index

glibc  2.9
bug-atexit1.c
Go to the documentation of this file.
00001 /* Derived from a test case in
00002    http://sourceware.org/bugzilla/show_bug.cgi?id=1158.  */
00003 #include <dlfcn.h>
00004 #include <stdio.h>
00005 #include <stdlib.h>
00006 
00007 static int
00008 do_test (void)
00009 {
00010   for (int i = 0; i < 2; ++i)
00011     {
00012       void *dso = dlopen ("$ORIGIN/bug-atexit1-lib.so", RTLD_NOW);
00013       void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
00014       fn ();
00015       dlclose (dso);
00016       puts ("round done");
00017     }
00018 
00019   return 0;
00020 }
00021 
00022 #define TEST_FUNCTION do_test ()
00023 #include "../test-skeleton.c"