summaryrefslogtreecommitdiff
path: root/system/ksh-openbsd/patches/linux/jobs_c.diff
blob: e50ffd3a940c1462b853108bba80b72ab3c38f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- ksh-openbsd_cvs/jobs.c	2010-02-23 12:49:17.000000000 +0100
+++ ksh-openbsd_cvs.new/jobs.c	2010-04-01 21:01:24.133232595 +0200
@@ -21,6 +21,19 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 #include "tty.h"
+#include "strlcpy.h"
+
+#ifndef CHILD_MAX
+# if defined(HAVE_SYSCONF) && defined(_SC_CHILD_MAX)
+#  define CHILD_MAX sysconf(_SC_CHILD_MAX)
+# else /* _SC_CHILD_MAX */
+#  ifdef _POSIX_CHILD_MAX
+#   define CHILD_MAX    ((_POSIX_CHILD_MAX) * 2)
+#  else /* _POSIX_CHILD_MAX */
+#   define CHILD_MAX    20
+#  endif /* _POSIX_CHILD_MAX */
+# endif /* _SC_CHILD_MAX */
+#endif /* !CHILD_MAX */
 
 /* Order important! */
 #define PRUNNING	0