Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / builtins / ulimit.def
index 7c1e256..e551cff 100644 (file)
@@ -1,7 +1,7 @@
 This file is ulimit.def, from which is created ulimit.c.
 It implements the builtin "ulimit" in Bash.
 
-Copyright (C) 1987-2009 Free Software Foundation, Inc.
+Copyright (C) 1987-2010 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -23,7 +23,7 @@ $PRODUCES ulimit.c
 $BUILTIN ulimit
 $FUNCTION ulimit_builtin
 $DEPENDS_ON !_MINIX
-$SHORT_DOC ulimit [-SHacdefilmnpqrstuvx] [limit]
+$SHORT_DOC ulimit [-SHabcdefilmnpqrstuvxT] [limit]
 Modify shell resource limits.
 
 Provides control over the resources available to the shell and processes
@@ -50,6 +50,9 @@ Options:
   -u   the maximum number of user processes
   -v   the size of virtual memory
   -x   the maximum number of file locks
+  -T    the maximum number of threads
+
+Not all options are available on all platforms.
 
 If LIMIT is given, it is the new value of the specified resource; the
 special LIMIT values `soft', `hard', and `unlimited' stand for the
@@ -70,7 +73,7 @@ $END
 #include <config.h>
 
 #include "../bashtypes.h"
-#ifndef _MINIX
+#if defined (HAVE_SYS_PARAM_H)
 #  include <sys/param.h>
 #endif
 
@@ -118,6 +121,10 @@ extern int errno;
 #  undef HAVE_RESOURCE
 #endif
 
+#if !defined (HAVE_RESOURCE) && defined (HAVE_ULIMIT_H)
+#  include <ulimit.h>
+#endif
+
 #if !defined (RLIMTYPE)
 #  define RLIMTYPE long
 #  define string_to_rlimtype(s) strtol(s, (char **)NULL, 10)
@@ -163,6 +170,10 @@ extern int errno;
 #  define RLIMIT_MAXUPROC      260
 #endif
 
+#if !defined (RLIMIT_PTHREAD) && defined (RLIMIT_NTHR)
+#  define RLIMIT_PTHREAD RLIMIT_NTHR
+#endif
+
 #if !defined (RLIM_INFINITY)
 #  define RLIM_INFINITY 0x7fffffff
 #endif