Process stat in import_resolver.
@@ -16,6 +16,9 @@ static int read_byte (MIR_context_t ctx) {
}
#include <dlfcn.h>
+#if defined(__unix__) || defined(__APPLE__)
+#include <sys/stat.h>
+#endif
static struct lib {
char *name;
@@ -42,6 +45,9 @@ static void *import_resolver (const char *name) {
if (strcmp (name, "dlopen") == 0) return dlopen;
if (strcmp (name, "dlsym") == 0) return dlsym;
if (strcmp (name, "dlclose") == 0) return dlclose;
+#if defined(__unix__) || defined(__APPLE__)
+ if (strcmp (name, "stat") == 0) return stat;
+#endif
for (int i = 0; i < sizeof (libs) / sizeof (struct lib); i++) {
if ((sym = dlsym (libs[i].handler, name)) != NULL) break;
}
