Merged sbcl-1.0.14 with the sb-simd 1.3 patches
[sbcl/simd.git] / tools-for-build / os-provides-dladdr-test.c
blobba899a23174c1920651e5e709cb2dcd28dff4393
1 /* test to build and run so that we know if we have dladdr
2 */
4 /* bloody FSF dlcfn.h won't give us dladdr without this */
5 #define _GNU_SOURCE
7 #include <dlfcn.h>
9 int main ()
11 void * handle = dlopen((void*)0, RTLD_GLOBAL | RTLD_NOW);
12 void * addr = dlsym(handle, "printf");
13 Dl_info * info = (Dl_info*) malloc(sizeof(Dl_info));
14 dladdr(addr, info);
15 if (strcmp(info->dli_sname, "printf")) {
16 return 1;
17 } else {
18 return 104;