summaryrefslogtreecommitdiff
path: root/tests/headers/dlfcn.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-15 14:42:29 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-15 14:42:29 +0100
commit7cd3b7caee10d62f7be674afb86a136bf30485d6 (patch)
tree121a8c79114174b765713387187d930b102f760f /tests/headers/dlfcn.c
parent3b3325f761b09ebbfef04c44eed546cc4fdeb329 (diff)
Add mqueue rt api, add header tests
Diffstat (limited to 'tests/headers/dlfcn.c')
-rw-r--r--tests/headers/dlfcn.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/headers/dlfcn.c b/tests/headers/dlfcn.c
new file mode 100644
index 00000000..0a1242d2
--- /dev/null
+++ b/tests/headers/dlfcn.c
@@ -0,0 +1,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));
+}