| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: miscbltin.c,v 1.40 2011/10/11 15:27:11 christos Exp $ */ | | 1 | /* $NetBSD: miscbltin.c,v 1.41 2012/06/09 02:49:48 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1991, 1993 | | 4 | * Copyright (c) 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Kenneth Almquist. | | 8 | * Kenneth Almquist. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -27,27 +27,27 @@ | | | @@ -27,27 +27,27 @@ |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | #ifndef lint | | 36 | #ifndef lint |
37 | #if 0 | | 37 | #if 0 |
38 | static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; | | 38 | static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; |
39 | #else | | 39 | #else |
40 | __RCSID("$NetBSD: miscbltin.c,v 1.40 2011/10/11 15:27:11 christos Exp $"); | | 40 | __RCSID("$NetBSD: miscbltin.c,v 1.41 2012/06/09 02:49:48 christos Exp $"); |
41 | #endif | | 41 | #endif |
42 | #endif /* not lint */ | | 42 | #endif /* not lint */ |
43 | | | 43 | |
44 | /* | | 44 | /* |
45 | * Miscelaneous builtins. | | 45 | * Miscelaneous builtins. |
46 | */ | | 46 | */ |
47 | | | 47 | |
48 | #include <sys/types.h> /* quad_t */ | | 48 | #include <sys/types.h> /* quad_t */ |
49 | #include <sys/param.h> /* BSD4_4 */ | | 49 | #include <sys/param.h> /* BSD4_4 */ |
50 | #include <sys/stat.h> | | 50 | #include <sys/stat.h> |
51 | #include <sys/time.h> | | 51 | #include <sys/time.h> |
52 | #include <sys/resource.h> | | 52 | #include <sys/resource.h> |
53 | #include <unistd.h> | | 53 | #include <unistd.h> |
| @@ -320,26 +320,29 @@ static const struct limits limits[] = { | | | @@ -320,26 +320,29 @@ static const struct limits limits[] = { |
320 | #endif | | 320 | #endif |
321 | #ifdef RLIMIT_STACK | | 321 | #ifdef RLIMIT_STACK |
322 | { "stack", "kbytes", RLIMIT_STACK, 1024, 's' }, | | 322 | { "stack", "kbytes", RLIMIT_STACK, 1024, 's' }, |
323 | #endif | | 323 | #endif |
324 | #ifdef RLIMIT_CORE | | 324 | #ifdef RLIMIT_CORE |
325 | { "coredump", "blocks", RLIMIT_CORE, 512, 'c' }, | | 325 | { "coredump", "blocks", RLIMIT_CORE, 512, 'c' }, |
326 | #endif | | 326 | #endif |
327 | #ifdef RLIMIT_RSS | | 327 | #ifdef RLIMIT_RSS |
328 | { "memory", "kbytes", RLIMIT_RSS, 1024, 'm' }, | | 328 | { "memory", "kbytes", RLIMIT_RSS, 1024, 'm' }, |
329 | #endif | | 329 | #endif |
330 | #ifdef RLIMIT_MEMLOCK | | 330 | #ifdef RLIMIT_MEMLOCK |
331 | { "locked memory","kbytes", RLIMIT_MEMLOCK, 1024, 'l' }, | | 331 | { "locked memory","kbytes", RLIMIT_MEMLOCK, 1024, 'l' }, |
332 | #endif | | 332 | #endif |
| | | 333 | #ifdef RLIMIT_NTHR |
| | | 334 | { "thread", "threads", RLIMIT_NTHR, 1, 'r' }, |
| | | 335 | #endif |
333 | #ifdef RLIMIT_NPROC | | 336 | #ifdef RLIMIT_NPROC |
334 | { "process", "processes", RLIMIT_NPROC, 1, 'p' }, | | 337 | { "process", "processes", RLIMIT_NPROC, 1, 'p' }, |
335 | #endif | | 338 | #endif |
336 | #ifdef RLIMIT_NOFILE | | 339 | #ifdef RLIMIT_NOFILE |
337 | { "nofiles", "descriptors", RLIMIT_NOFILE, 1, 'n' }, | | 340 | { "nofiles", "descriptors", RLIMIT_NOFILE, 1, 'n' }, |
338 | #endif | | 341 | #endif |
339 | #ifdef RLIMIT_VMEM | | 342 | #ifdef RLIMIT_VMEM |
340 | { "vmemory", "kbytes", RLIMIT_VMEM, 1024, 'v' }, | | 343 | { "vmemory", "kbytes", RLIMIT_VMEM, 1024, 'v' }, |
341 | #endif | | 344 | #endif |
342 | #ifdef RLIMIT_SWAP | | 345 | #ifdef RLIMIT_SWAP |
343 | { "swap", "kbytes", RLIMIT_SWAP, 1024, 'w' }, | | 346 | { "swap", "kbytes", RLIMIT_SWAP, 1024, 'w' }, |
344 | #endif | | 347 | #endif |
345 | #ifdef RLIMIT_SBSIZE | | 348 | #ifdef RLIMIT_SBSIZE |