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.
$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
-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
#include <config.h>
#include "../bashtypes.h"
-#ifndef _MINIX
+#if defined (HAVE_SYS_PARAM_H)
# include <sys/param.h>
#endif
# 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)
# 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