2 * Copyright (c) 2013, 2015
3 * mirabilos <m@mirbsd.org>
5 * Provided that these terms and disclaimer and all copyright notices
6 * are retained or reproduced in an accompanying document, permission
7 * is granted to deal in this work without restriction, including un-
8 * limited rights to use, publicly perform, distribute, sell, modify,
9 * merge, give away, or sublicence.
11 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
12 * the utmost extent permitted by applicable law, neither express nor
13 * implied; without malicious intent or gross negligence. In no event
14 * may a licensor, author or contributor be held liable for indirect,
15 * direct, other damage, loss, or other issues arising in any way out
16 * of dealing in the work, even if advised of the possibility of such
17 * damage or existence of a defect, except proven that it results out
18 * of said person's immediate fault when using the work as intended.
22 __RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.3 2015/12/12 21:08:44 tg Exp $");
24 #define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid),
27 /* generic options for the ulimit builtin */
33 /* do not use options -H, -S or -a or change the order */
36 FN("time(cpu-seconds)", RLIMIT_CPU, 1
39 FN("file(blocks)", RLIMIT_FSIZE, 512
42 FN("coredump(blocks)", RLIMIT_CORE, 512
45 FN("data(KiB)", RLIMIT_DATA, 1024
48 FN("stack(KiB)", RLIMIT_STACK, 1024
51 FN("lockedmem(KiB)", RLIMIT_MEMLOCK, 1024
54 FN("nofiles(descriptors)", RLIMIT_NOFILE, 1
57 FN("processes", RLIMIT_NPROC, 1
60 FN("swap(KiB)", RLIMIT_SWAP, 1024
63 FN("humantime(seconds)", RLIMIT_TIME, 1
66 FN("vnodemonitors", RLIMIT_NOVMON, 1
69 FN("sigpending", RLIMIT_SIGPENDING, 1
72 FN("msgqueue(bytes)", RLIMIT_MSGQUEUE, 1
75 FN("AIOlockedmem(KiB)", RLIMIT_AIO_MEM, 1024
78 FN("AIOoperations", RLIMIT_AIO_OPS, 1
81 FN("cachedthreads", RLIMIT_TCACHE, 1
84 FN("sockbufsiz(KiB)", RLIMIT_SBSIZE, 1024
87 FN("threadsperprocess", RLIMIT_PTHREAD, 1
90 FN("maxnice", RLIMIT_NICE, 1
93 FN("maxrtprio", RLIMIT_RTPRIO, 1
96 FN("resident-set(KiB)", RLIMIT_RSS, 1024
98 FN("memory(KiB)", RLIMIT_VMEM, 1024
101 FN("virtual-memory(KiB)", RLIMIT_VMEM, 1024
103 FN("address-space(KiB)", RLIMIT_AS, 1024