Add missing include
[mono-project.git] / mono / utils / mono-dl-wasm.c
blobf325b51324460b86049ba29ba2c796edf20ad87f
1 #include <config.h>
3 #if defined (HOST_WASM)
5 #include "mono/utils/mono-dl.h"
6 #include "mono/utils/mono-embed.h"
7 #include "mono/utils/mono-path.h"
9 #include <stdlib.h>
10 #include <stdio.h>
11 #include <ctype.h>
12 #include <string.h>
13 #include <glib.h>
14 #include <dlfcn.h>
16 const char *
17 mono_dl_get_so_prefix (void)
19 return "";
22 const char **
23 mono_dl_get_so_suffixes (void)
25 static const char *suffixes[] = {
26 ".wasm", //we only recognize .wasm files for DSOs.
27 "",
29 return suffixes;
32 int
33 mono_dl_get_executable_path (char *buf, int buflen)
35 strncpy (buf, "/managed", buflen); //This is a packaging convertion that our tooling should enforce
36 return 0;
39 const char*
40 mono_dl_get_system_dir (void)
42 return NULL;
46 void*
47 mono_dl_lookup_symbol (MonoDl *module, const char *name)
49 return dlsym(module->handle, name);
52 char*
53 mono_dl_current_error_string (void)
55 return g_strdup ("");
59 int
60 mono_dl_convert_flags (int flags)
62 int lflags = flags & MONO_DL_LOCAL ? 0 : RTLD_GLOBAL;
64 if (flags & MONO_DL_LAZY)
65 lflags |= RTLD_LAZY;
66 else
67 lflags |= RTLD_NOW;
68 return lflags;
71 void *
72 mono_dl_open_file (const char *file, int flags)
74 return dlopen(file, flags);
77 void
78 mono_dl_close_handle (MonoDl *module)
80 dlclose(module->handle);
83 #endif