about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-04-13 22:25:04 +0000
committerClint Adams <clint@users.sourceforge.net>2000-04-13 22:25:04 +0000
commitc281f5c3bac7dcd38009018f5401c0c43285e140 (patch)
treebf5a49c70649460e37fc19feecbf67a17eafdbb0
parent6372332a92705260211c29701653e75443a54d20 (diff)
downloadzsh-c281f5c3bac7dcd38009018f5401c0c43285e140.tar.gz
zsh-c281f5c3bac7dcd38009018f5401c0c43285e140.tar.xz
zsh-c281f5c3bac7dcd38009018f5401c0c43285e140.zip
10745: MAXJOB = MAX_TASKS_PER_USER from linux/tasks.h
-rw-r--r--ChangeLog4
-rw-r--r--Src/zsh.h5
-rw-r--r--acconfig.h4
-rw-r--r--configure.in24
4 files changed, 34 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b1a71a7f..dbf33d956 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-13  Clint Adams  <schizo@debian.org>
+	* 10745: acconfig.h, configure.in, Src/zsh.h: set MAXJOB
+	to MAX_TASKS_PER_USER if available under Linux.
+
 2000-04-13  Peter Stephenson  <pws@cambridgesiliconradio.com>
 
 	* 10743: Src/params.c: replenv() failed importing special params
diff --git a/Src/zsh.h b/Src/zsh.h
index 5d1a8b1c8..306cc82e5 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -661,8 +661,9 @@ struct eccstr {
 /* Defintions for job table and job control */
 /********************************************/
 
-/* size of job table */
-#define MAXJOB 50
+#ifdef NEED_LINUX_TASKS_H
+#include <linux/tasks.h>
+#endif
 
 /* entry in the job table */
 
diff --git a/acconfig.h b/acconfig.h
index 92ae69422..2f553d1b3 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -139,6 +139,10 @@
 /* Define to be a string corresponding the vendor of the machine */
 #undef VENDOR
 
+/* Define to limit job table size */
+#undef MAXJOB
+#undef NEED_LINUX_TASKS_H
+
 /* Define if your system defines `struct winsize' in sys/ptem.h.  */
 #undef WINSIZE_IN_PTEM
 
diff --git a/configure.in b/configure.in
index 2fde12a56..fddc6070f 100644
--- a/configure.in
+++ b/configure.in
@@ -443,7 +443,8 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
 		 termios.h sys/param.h sys/filio.h string.h memory.h \
 		 limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
 		 locale.h errno.h stdlib.h unistd.h sys/capability.h \
-		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h)
+		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
+		 linux/tasks.h)
 if test $dynamic = yes; then
   AC_CHECK_HEADERS(dlfcn.h)
   AC_CHECK_HEADERS(dl.h)
@@ -497,6 +498,27 @@ fi
  
 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
 
+dnl Try to get a sane value for MAXJOB
+linux_tasks_defines_mtpu=no
+AC_MSG_CHECKING(what to set MAXJOB to)
+if test $ac_cv_header_linux_tasks_h = yes; then
+AC_EGREP_CPP(yes,
+[#include <linux/tasks.h>
+ #ifdef MAX_TASKS_PER_USER
+ yes
+ #endif
+], linux_tasks_defines_mtpu=yes)
+fi
+
+if test $linux_tasks_defines_mtpu = yes; then
+AC_DEFINE(MAXJOB, MAX_TASKS_PER_USER)
+AC_DEFINE(NEED_LINUX_TASKS_H)
+AC_MSG_RESULT(${msg}MAX_TASKS_PER_USER)
+else
+AC_DEFINE(MAXJOB, 50)
+AC_MSG_RESULT(${msg}50)
+fi
+
 dnl -------------------
 dnl CHECK FOR LIBRARIES
 dnl -------------------