diff --git a/common/arg.cpp b/common/arg.cpp
--- a/llama.cpp/common/arg.cpp
+++ b/llama.cpp/common/arg.cpp
@@ -39,6 +39,8 @@
 #ifndef __EMSCRIPTEN__
 #ifdef __linux__
 #include <linux/limits.h>
+#elif defined(COSMOCC)
+#include <linux/limits.h>
 #elif defined(_WIN32)
 #   if !defined(PATH_MAX)
 #   define PATH_MAX MAX_PATH
