1@RLIMITS_DEFNS 2__RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.1 2013/11/17 22:21:18 tg Exp $"); 3struct limits { 4 /* limit resource */ 5 int resource; 6 /* multiply by to get rlim_{cur,max} values */ 7 unsigned int factor; 8 /* getopts char */ 9 char optchar; 10 /* limit name */ 11 char name[1]; 12}; 13#define FN(lname,lid,lfac,lopt) static const struct { int resource; unsigned int factor; char optchar; char name[sizeof(lname)]; } rlimits_ ## lid = { lid, lfac, lopt, lname }; 14@RLIMITS_ITEMS 15#define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid), 16@@ 17 18/* generic options for the ulimit builtin */ 19 20<a| 21<H| 22<S| 23 24/* do not use options -H, -S or -a or change the order */ 25 26>t|RLIMIT_CPU 27FN("time(cpu-seconds)", RLIMIT_CPU, 1 28 29>f|RLIMIT_FSIZE 30FN("file(blocks)", RLIMIT_FSIZE, 512 31 32>c|RLIMIT_CORE 33FN("coredump(blocks)", RLIMIT_CORE, 512 34 35>d|RLIMIT_DATA 36FN("data(KiB)", RLIMIT_DATA, 1024 37 38>s|RLIMIT_STACK 39FN("stack(KiB)", RLIMIT_STACK, 1024 40 41>l|RLIMIT_MEMLOCK 42FN("lockedmem(KiB)", RLIMIT_MEMLOCK, 1024 43 44>n|RLIMIT_NOFILE 45FN("nofiles(descriptors)", RLIMIT_NOFILE, 1 46 47>p|RLIMIT_NPROC 48FN("processes", RLIMIT_NPROC, 1 49 50>w|RLIMIT_SWAP 51FN("swap(KiB)", RLIMIT_SWAP, 1024 52 53>T|RLIMIT_TIME 54FN("humantime(seconds)", RLIMIT_TIME, 1 55 56>V|RLIMIT_NOVMON 57FN("vnodemonitors", RLIMIT_NOVMON, 1 58 59>i|RLIMIT_SIGPENDING 60FN("sigpending", RLIMIT_SIGPENDING, 1 61 62>q|RLIMIT_MSGQUEUE 63FN("msgqueue(bytes)", RLIMIT_MSGQUEUE, 1 64 65>M|RLIMIT_AIO_MEM 66FN("AIOlockedmem(KiB)", RLIMIT_AIO_MEM, 1024 67 68>O|RLIMIT_AIO_OPS 69FN("AIOoperations", RLIMIT_AIO_OPS, 1 70 71>C|RLIMIT_TCACHE 72FN("cachedthreads", RLIMIT_TCACHE, 1 73 74>B|RLIMIT_SBSIZE 75FN("sockbufsiz(KiB)", RLIMIT_SBSIZE, 1024 76 77>P|RLIMIT_PTHREAD 78FN("threadsperprocess", RLIMIT_PTHREAD, 1 79 80>e|RLIMIT_NICE 81FN("maxnice", RLIMIT_NICE, 1 82 83>r|RLIMIT_RTPRIO 84FN("maxrtprio", RLIMIT_RTPRIO, 1 85 86>m|ULIMIT_M_IS_RSS 87FN("resident-set(KiB)", RLIMIT_RSS, 1024 88>m|ULIMIT_M_IS_VMEM 89FN("memory(KiB)", RLIMIT_VMEM, 1024 90 91>v|ULIMIT_V_IS_VMEM 92FN("virtual-memory(KiB)", RLIMIT_VMEM, 1024 93>v|ULIMIT_V_IS_AS 94FN("address-space(KiB)", RLIMIT_AS, 1024 95 96|RLIMITS_OPTCS 97