From 089201c2fdb2a00fd6fc70029fb1b2456ae401f9 Mon Sep 17 00:00:00 2001 From: njoly Date: Mon, 11 Jun 2012 18:28:10 +0000 Subject: [PATCH] Allow thread limit queries by adding the new -r flag to ulimit. Add the corresponding documentation in the man page. --- bin/sh/miscbltin.c | 6 +++--- bin/sh/sh.1 | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index db1ef97123ad..b7c1c5ad8cb7 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -1,4 +1,4 @@ -/* $NetBSD: miscbltin.c,v 1.41 2012/06/09 02:49:48 christos Exp $ */ +/* $NetBSD: miscbltin.c,v 1.42 2012/06/11 18:28:10 njoly Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: miscbltin.c,v 1.41 2012/06/09 02:49:48 christos Exp $"); +__RCSID("$NetBSD: miscbltin.c,v 1.42 2012/06/11 18:28:10 njoly Exp $"); #endif #endif /* not lint */ @@ -364,7 +364,7 @@ ulimitcmd(int argc, char **argv) struct rlimit limit; what = 'f'; - while ((optc = nextopt("HSabtfdsmcnplv")) != '\0') + while ((optc = nextopt("HSabtfdscmlrpnv")) != '\0') switch (optc) { case 'H': how = HARD; diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 968cbc10f060..984a4d9305fc 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: sh.1,v 1.106 2011/10/05 13:15:30 christos Exp $ +.\" $NetBSD: sh.1,v 1.107 2012/06/11 18:28:10 njoly Exp $ .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -31,7 +31,7 @@ .\" .\" @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" -.Dd October 4, 2011 +.Dd June 11, 2012 .Dt SH 1 .Os .Sh NAME @@ -1731,7 +1731,7 @@ command, tracked alias and not found. For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed. -.It ulimit Oo Fl H \*(Ba Fl S Oc Oo Fl a \*(Ba Fl tfdscmlpnv Oo Ar value Oc Oc +.It ulimit Oo Fl H \*(Ba Fl S Oc Oo Fl a \*(Ba Fl btfdscmlrpnv Oo Ar value Oc Oc Inquire about or set the hard or soft limits on processes or set new limits. The choice between hard limit (which no process is allowed to @@ -1777,6 +1777,9 @@ in use by a process (in kilobytes) show or set the limit on how much memory a process can lock with .Xr mlock 2 (in kilobytes) +.It Fl r +show or set the limit on the number of threads this user can +have at one time .It Fl p show or set the limit on the number of processes this user can have at one time