summaryrefslogtreecommitdiff
path: root/tests/headers/dlfcn.c
blob: 0a1242d2cc0501ca13cbc1880d6c4f4d20d55fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/dlfcn.h.html

#include "core.h"

#include <dlfcn.h>

TEST(dlfcn_h)
{
	TYPE(Dl_info_t);

	STRUCT_MEMBER(Dl_info_t, const char *, dli_fname);
	STRUCT_MEMBER(Dl_info_t, void *, dli_fbase);
	STRUCT_MEMBER(Dl_info_t, const char *, dli_sname);
	STRUCT_MEMBER(Dl_info_t, void *, dli_saddr);

	MACRO_VALUE(RTLD_LAZY, 1);
	MACRO_VALUE(RTLD_NOW, 2);
	MACRO_VALUE(RTLD_GLOBAL, 256);
	MACRO_VALUE(RTLD_LOCAL, 0);

	FUNCTION(dladdr, int (*f)(const void *restrict, Dl_info_t *restrict));
	FUNCTION(dlclose, int (*f)(void *));
	FUNCTION(dlerror, char *(*f)(void));
	FUNCTION(dlopen, void *(*f)(const char *, int));
	FUNCTION(dlsym, void *(*f)(void *restrict, const char *restrict));
}