1.0.29.41: inline CTOR caches for MAKE-INSTANCE
[sbcl/pkhuong.git] / tools-for-build / os-provides-dladdr-test.c
blobd7795b450fa865ba7b2160cc4fb4424919251008
1 /* test to build and run so that we know if we have dladdr
2 */
4 #include <stdlib.h>
6 /* bloody FSF dlcfn.h won't give us dladdr without this */
7 #define _GNU_SOURCE
9 #include <dlfcn.h>
11 int main ()
13 void * handle = dlopen((void*)0, RTLD_GLOBAL | RTLD_NOW);
14 void * addr = dlsym(handle, "printf");
15 Dl_info * info = (Dl_info*) malloc(sizeof(Dl_info));
16 if (dladdr(addr, info) == 0) {
17 return 1;
18 } else {
19 return 104;