]> git.ipfire.org Git - thirdparty/glibc.git/blame - dlfcn/failtestmod.c
INSTALL, install.texi: minor updates, regenerate
[thirdparty/glibc.git] / dlfcn / failtestmod.c
CommitLineData
d743ba1e
UD
1#include <dlfcn.h>
2#include <stdio.h>
3
4
20bb2883 5extern void constr (void) __attribute__ ((__constructor__));
d743ba1e
UD
6void
7__attribute__ ((__constructor__))
8constr (void)
9{
10 void *handle;
d743ba1e
UD
11
12 /* Open the library. */
13 handle = dlopen (NULL, RTLD_NOW);
14 if (handle == NULL)
15 {
16 puts ("Cannot get handle to own object");
17 return;
18 }
19
20 /* Get a symbol. */
9114625b 21 dlsym (handle, "main");
d743ba1e
UD
22 puts ("called dlsym() to get main");
23
24 dlclose (handle);
25}