Index: openmpi-5.0.6/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
+++ openmpi-5.0.6/3rd-party/romio341/mpi-io/mpir_cst_filesys.c
@@ -13,6 +13,10 @@
 #include <dirent.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #ifdef MPICH
 
 static int comm_split_filesystem_exhaustive(MPI_Comm comm, int key,
Index: openmpi-5.0.6/3rd-party/romio341/mpl/src/str/mpl_str.c
===================================================================
--- openmpi-5.0.6.orig/3rd-party/romio341/mpl/src/str/mpl_str.c
+++ openmpi-5.0.6/3rd-party/romio341/mpl/src/str/mpl_str.c
@@ -22,6 +22,10 @@
 #include <time.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #if !defined MPL_HAVE_SNPRINTF
 int MPL_snprintf(char *str, size_t size, const char *format, ...)
 {
