More disambiguation of Python in makefiles (#18284)
[mono-project.git] / mono / utils / mono-dl-wasm.c
blobcd1ce22495e96805cf292eeb0d28c07d0e993e3e
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 NULL;
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 = 0;
64 #ifdef ENABLE_NETCORE
65 // Specifying both will default to LOCAL
66 if (flags & MONO_DL_LOCAL)
67 lflags |= RTLD_LOCAL;
68 else if (flags & MONO_DL_GLOBAL)
69 lflags |= RTLD_GLOBAL;
70 #else
71 lflags = flags & MONO_DL_LOCAL ? RTLD_LOCAL : RTLD_GLOBAL;
72 #endif
74 if (flags & MONO_DL_LAZY)
75 lflags |= RTLD_LAZY;
76 else
77 lflags |= RTLD_NOW;
79 return lflags;
82 void *
83 mono_dl_open_file (const char *file, int flags)
85 // Actual dlopen is done in driver.c:wasm_dl_load()
86 return NULL;
89 void
90 mono_dl_close_handle (MonoDl *module)
94 #endif