about summary refs log tree commit diff
path: root/Src/Builtins
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-08-17 11:12:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-08-17 11:12:34 +0000
commit9fdcd824d8df307081723ec5f0ae04c838b2b7b8 (patch)
tree0808f7bc974fb6bdf01bbbf47ea18e808e4ef8dd /Src/Builtins
parent3aae0ef8fecd69c983e6452a6b4f9c641cac9ab1 (diff)
downloadzsh-9fdcd824d8df307081723ec5f0ae04c838b2b7b8.tar.gz
zsh-9fdcd824d8df307081723ec5f0ae04c838b2b7b8.tar.xz
zsh-9fdcd824d8df307081723ec5f0ae04c838b2b7b8.zip
30627: support RLIMIT_NTHR as on NetBSD
Diffstat (limited to 'Src/Builtins')
-rw-r--r--Src/Builtins/rlimits.awk1
-rw-r--r--Src/Builtins/rlimits.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/Src/Builtins/rlimits.awk b/Src/Builtins/rlimits.awk
index 418206a66..bf914814d 100644
--- a/Src/Builtins/rlimits.awk
+++ b/Src/Builtins/rlimits.awk
@@ -42,6 +42,7 @@ BEGIN {limidx = 0}
 	    if (limnam == "MEMLOCK") { msg[limnum] = "Mmemorylocked" }
 	    if (limnam == "NOFILE")  { msg[limnum] = "Ndescriptors" }
 	    if (limnam == "NPROC")   { msg[limnum] = "Nmaxproc" }
+	    if (limnam == "NTHR")    { msg[limnum] = "Nmaxthr" }
 	    if (limnam == "OFILE")   { msg[limnum] = "Ndescriptors" }
 	    if (limnam == "PTHREAD") { msg[limnum] = "Nmaxpthreads" }
 	    if (limnam == "RSS")     { msg[limnum] = "Mresident" }
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 670516169..45d5b2dea 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -314,6 +314,12 @@ printulimit(char *nam, int lim, int hard, int head)
 	    printf("-u: processes                  ");
 	break;
 # endif /* HAVE_RLIMIT_NPROC */
+# ifdef HAVE_RLIMIT_NTHR
+    case RLIMIT_NTHR:
+	if (head)
+	    printf("-r: threads                    ");
+	break;
+#endif /* HAVE_RLIMIT_NTHR */
 # if defined(HAVE_RLIMIT_VMEM) && (!defined(HAVE_RLIMIT_RSS) || !defined(RLIMIT_VMEM_IS_RSS))
     case RLIMIT_VMEM:
 	if (head)
@@ -791,6 +797,11 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 		    res = RLIMIT_NOFILE;
 		    break;
 # endif /* HAVE_RLIMIT_NOFILE */
+# ifdef HAVE_RLIMIT_NTHR
+		case 'r':
+		    res = RLIMIT_NTHR;
+		    break;
+# endif /* HAVE_RLIMIT_NTHR */
 # ifdef HAVE_RLIMIT_NPROC
 		case 'u':
 		    res = RLIMIT_NPROC;