]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
mmap: add Haiku support by skipping RLIMIT_MEMLOCK check (#18819)
authorDaniel Benjaminsson <redacted>
Wed, 14 Jan 2026 07:11:05 +0000 (08:11 +0100)
committerGitHub <redacted>
Wed, 14 Jan 2026 07:11:05 +0000 (09:11 +0200)
Haiku OS does not support RLIMIT_MEMLOCK, similar to visionOS/tvOS.
Skip the resource limit check on Haiku to allow mlock functionality
to work without compile errors.

Tested on Haiku with NVIDIA RTX 3080 Ti using Vulkan backend.

src/llama-mmap.cpp

index 0c43495b11db3d4e7fadd79efc3d0f93c66b89a7..fe0847fe1a4e62384a5c86fa84dd074889265a9f 100644 (file)
@@ -614,9 +614,9 @@ struct llama_mlock::impl {
 
         char* errmsg = std::strerror(errno);
         bool suggest = (errno == ENOMEM);
-#if defined(TARGET_OS_VISION) || defined(TARGET_OS_TV) || defined(_AIX)
-        // visionOS/tvOS dont't support RLIMIT_MEMLOCK
-        // Skip resource limit checks on visionOS/tvOS
+#if defined(TARGET_OS_VISION) || defined(TARGET_OS_TV) || defined(_AIX) || defined(__HAIKU__)
+        // visionOS/tvOS/Haiku don't support RLIMIT_MEMLOCK
+        // Skip resource limit checks on these platforms
         suggest = false;
 #else
         struct rlimit lock_limit;