fix: ports - netsurf renders pages (mmap, resources, error loop)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQRTGoYgnZQsh7uCh6Jsxm
This commit is contained in:
2026-08-08 14:44:53 +02:00
co-authored by Claude Opus 5
parent f4dce0cdd6
commit 15f508d003
6 changed files with 250 additions and 24 deletions
@@ -1,5 +1,5 @@
diff --git a/utils/config.h b/utils/config.h
index 3914771fd..09f2659d6 100644
index 3914771fd..578280321 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -119,7 +119,7 @@ char *strchrnul(const char *s, int c);
@@ -11,7 +11,22 @@ index 3914771fd..09f2659d6 100644
#undef HAVE_UTSNAME
#endif
@@ -158,14 +158,14 @@ char *realpath(const char *path, char *resolved_path);
@@ -144,8 +144,13 @@ char *realpath(const char *path, char *resolved_path);
#undef HAVE_STDOUT
#endif
+/* MontaukOS: the libc mmap() is anonymous-only (it is a thin wrapper over
+ * SYS_ALLOC and rejects any fd != -1), so the file fetcher's
+ * mmap(..., MAP_SHARED, fd, 0) fails and every file: URL dies with "Unable to
+ * map memory for file data buffer". The fread() fallback in the same function
+ * is what we want. */
#define HAVE_MMAP
-#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
+#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__) || defined(__montauk__))
#undef HAVE_MMAP
#endif
@@ -158,14 +163,14 @@ char *realpath(const char *path, char *resolved_path);
#define HAVE_DIRFD
#define HAVE_UNLINKAT
#define HAVE_FSTATAT