aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/dlfcn.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/posix/include/dlfcn.h
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/include/dlfcn.h')
-rw-r--r--lib/mlibc/options/posix/include/dlfcn.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/mlibc/options/posix/include/dlfcn.h b/lib/mlibc/options/posix/include/dlfcn.h
new file mode 100644
index 0000000..3bb8a02
--- /dev/null
+++ b/lib/mlibc/options/posix/include/dlfcn.h
@@ -0,0 +1,52 @@
+
+#ifndef _DLFCN_H
+#define _DLFCN_H
+
+#define RTLD_LOCAL 0
+#define RTLD_NOW 1
+#define RTLD_GLOBAL 2
+#define RTLD_NOLOAD 4
+#define RTLD_NODELETE 8
+#define RTLD_DEEPBIND 16
+#define RTLD_LAZY 32
+
+#define RTLD_NEXT ((void *)-1)
+#define RTLD_DEFAULT ((void *)0)
+
+#define RTLD_DI_LINKMAP 2
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __MLIBC_ABI_ONLY
+
+int dlclose(void *);
+char *dlerror(void);
+void *dlopen(const char *, int);
+void *dlsym(void *__restrict, const char *__restrict);
+void *dlvsym(void *__restrict, const char *__restrict, const char *__restrict);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+//gnu extension
+typedef struct {
+ const char *dli_fname;
+ void *dli_fbase;
+ const char *dli_sname;
+ void *dli_saddr;
+} Dl_info;
+
+#ifndef __MLIBC_ABI_ONLY
+
+int dladdr(const void *, Dl_info *);
+int dlinfo(void *, int, void *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _DLFCN_H
+