e896df
diff -Nrup a/src/main.c b/src/main.c
e896df
--- a/src/main.c	2016-05-31 03:17:26.000000000 -0400
e896df
+++ b/src/main.c	2016-09-22 16:18:52.283889265 -0400
e896df
@@ -2051,6 +2051,21 @@ main (int argc, char **argv, char **envp
e896df
     }
e896df
 #endif
e896df
 
e896df
+#ifdef PIPE_BUF
e896df
+  if (job_slots > PIPE_BUF)
e896df
+#elif defined _POSIX_PIPE_BUF
e896df
+  if (job_slots > _POSIX_PIPE_BUF)
e896df
+#else
e896df
+  if (job_slots > 512)
e896df
+#endif
e896df
+    {
e896df
+      O (error, NILF,
e896df
+            _("More parallel jobs (-jN) than this platform can handle requested."));
e896df
+      O (error, NILF, _("Resetting to single job (-j1) mode."));
e896df
+      job_slots = 1;
e896df
+    }
e896df
+
e896df
+
e896df
   /* If we have >1 slot at this point, then we're a top-level make.
e896df
      Set up the jobserver.
e896df