1c84f3f3cSopenharmony_ci/*- 2c84f3f3cSopenharmony_ci * Copyright (c) 2013, 2015, 2019 3c84f3f3cSopenharmony_ci * mirabilos <m@mirbsd.org> 4c84f3f3cSopenharmony_ci * 5c84f3f3cSopenharmony_ci * Provided that these terms and disclaimer and all copyright notices 6c84f3f3cSopenharmony_ci * are retained or reproduced in an accompanying document, permission 7c84f3f3cSopenharmony_ci * is granted to deal in this work without restriction, including un- 8c84f3f3cSopenharmony_ci * limited rights to use, publicly perform, distribute, sell, modify, 9c84f3f3cSopenharmony_ci * merge, give away, or sublicence. 10c84f3f3cSopenharmony_ci * 11c84f3f3cSopenharmony_ci * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to 12c84f3f3cSopenharmony_ci * the utmost extent permitted by applicable law, neither express nor 13c84f3f3cSopenharmony_ci * implied; without malicious intent or gross negligence. In no event 14c84f3f3cSopenharmony_ci * may a licensor, author or contributor be held liable for indirect, 15c84f3f3cSopenharmony_ci * direct, other damage, loss, or other issues arising in any way out 16c84f3f3cSopenharmony_ci * of dealing in the work, even if advised of the possibility of such 17c84f3f3cSopenharmony_ci * damage or existence of a defect, except proven that it results out 18c84f3f3cSopenharmony_ci * of said person's immediate fault when using the work as intended. 19c84f3f3cSopenharmony_ci *- 20c84f3f3cSopenharmony_ci * Keep {r,u}limits.opt in sync with each other! 21c84f3f3cSopenharmony_ci */ 22c84f3f3cSopenharmony_ci 23c84f3f3cSopenharmony_ci@RLIMITS_DEFNS 24c84f3f3cSopenharmony_ci__RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.5 2020/07/24 20:11:18 tg Exp $"); 25c84f3f3cSopenharmony_ci@RLIMITS_ITEMS 26c84f3f3cSopenharmony_ci#define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid), 27c84f3f3cSopenharmony_ci@@ 28c84f3f3cSopenharmony_ci 29c84f3f3cSopenharmony_ci/* generic options for the ulimit builtin */ 30c84f3f3cSopenharmony_ci 31c84f3f3cSopenharmony_ci<a| 32c84f3f3cSopenharmony_ci<H| 33c84f3f3cSopenharmony_ci<S| 34c84f3f3cSopenharmony_ci 35c84f3f3cSopenharmony_ci/* do not use options -H, -S or -a or change the order */ 36c84f3f3cSopenharmony_ci 37c84f3f3cSopenharmony_ci>t|RLIMIT_CPU 38c84f3f3cSopenharmony_ciFN("time(cpu-seconds)", RLIMIT_CPU, 1 39c84f3f3cSopenharmony_ci 40c84f3f3cSopenharmony_ci>f|RLIMIT_FSIZE 41c84f3f3cSopenharmony_ciFN("file(blocks)", RLIMIT_FSIZE, 512 42c84f3f3cSopenharmony_ci 43c84f3f3cSopenharmony_ci>c|RLIMIT_CORE 44c84f3f3cSopenharmony_ciFN("coredump(blocks)", RLIMIT_CORE, 512 45c84f3f3cSopenharmony_ci 46c84f3f3cSopenharmony_ci>d|RLIMIT_DATA 47c84f3f3cSopenharmony_ciFN("data(KiB)", RLIMIT_DATA, 1024 48c84f3f3cSopenharmony_ci 49c84f3f3cSopenharmony_ci>s|RLIMIT_STACK 50c84f3f3cSopenharmony_ciFN("stack(KiB)", RLIMIT_STACK, 1024 51c84f3f3cSopenharmony_ci 52c84f3f3cSopenharmony_ci>l|RLIMIT_MEMLOCK 53c84f3f3cSopenharmony_ciFN("lockedmem(KiB)", RLIMIT_MEMLOCK, 1024 54c84f3f3cSopenharmony_ci 55c84f3f3cSopenharmony_ci>n|RLIMIT_NOFILE 56c84f3f3cSopenharmony_ciFN("nofiles(descriptors)", RLIMIT_NOFILE, 1 57c84f3f3cSopenharmony_ci 58c84f3f3cSopenharmony_ci>p|RLIMIT_NPROC 59c84f3f3cSopenharmony_ciFN("processes", RLIMIT_NPROC, 1 60c84f3f3cSopenharmony_ci 61c84f3f3cSopenharmony_ci>w|RLIMIT_SWAP 62c84f3f3cSopenharmony_ciFN("swap(KiB)", RLIMIT_SWAP, 1024 63c84f3f3cSopenharmony_ci 64c84f3f3cSopenharmony_ci>T|RLIMIT_TIME 65c84f3f3cSopenharmony_ciFN("humantime(seconds)", RLIMIT_TIME, 1 66c84f3f3cSopenharmony_ci 67c84f3f3cSopenharmony_ci>V|RLIMIT_NOVMON 68c84f3f3cSopenharmony_ciFN("vnodemonitors", RLIMIT_NOVMON, 1 69c84f3f3cSopenharmony_ci 70c84f3f3cSopenharmony_ci>i|RLIMIT_SIGPENDING 71c84f3f3cSopenharmony_ciFN("sigpending", RLIMIT_SIGPENDING, 1 72c84f3f3cSopenharmony_ci 73c84f3f3cSopenharmony_ci>q|RLIMIT_MSGQUEUE 74c84f3f3cSopenharmony_ciFN("msgqueue(bytes)", RLIMIT_MSGQUEUE, 1 75c84f3f3cSopenharmony_ci 76c84f3f3cSopenharmony_ci>M|RLIMIT_AIO_MEM 77c84f3f3cSopenharmony_ciFN("AIOlockedmem(KiB)", RLIMIT_AIO_MEM, 1024 78c84f3f3cSopenharmony_ci 79c84f3f3cSopenharmony_ci>O|RLIMIT_AIO_OPS 80c84f3f3cSopenharmony_ciFN("AIOoperations", RLIMIT_AIO_OPS, 1 81c84f3f3cSopenharmony_ci 82c84f3f3cSopenharmony_ci>C|RLIMIT_TCACHE 83c84f3f3cSopenharmony_ciFN("cachedthreads", RLIMIT_TCACHE, 1 84c84f3f3cSopenharmony_ci 85c84f3f3cSopenharmony_ci>B|RLIMIT_SBSIZE 86c84f3f3cSopenharmony_ciFN("sockbufsiz(KiB)", RLIMIT_SBSIZE, 1024 87c84f3f3cSopenharmony_ci 88c84f3f3cSopenharmony_ci>P|RLIMIT_PTHREAD 89c84f3f3cSopenharmony_ciFN("threadsperprocess", RLIMIT_PTHREAD, 1 90c84f3f3cSopenharmony_ci 91c84f3f3cSopenharmony_ci>r|RLIMIT_THREADS 92c84f3f3cSopenharmony_ciFN("threadsperprocess", RLIMIT_THREADS, 1 93c84f3f3cSopenharmony_ci 94c84f3f3cSopenharmony_ci>e|RLIMIT_NICE 95c84f3f3cSopenharmony_ciFN("maxnice", RLIMIT_NICE, 1 96c84f3f3cSopenharmony_ci 97c84f3f3cSopenharmony_ci>r|RLIMIT_RTPRIO 98c84f3f3cSopenharmony_ciFN("maxrtprio", RLIMIT_RTPRIO, 1 99c84f3f3cSopenharmony_ci 100c84f3f3cSopenharmony_ci>m|ULIMIT_M_IS_RSS 101c84f3f3cSopenharmony_ciFN("resident-set(KiB)", RLIMIT_RSS, 1024 102c84f3f3cSopenharmony_ci>m|ULIMIT_M_IS_VMEM 103c84f3f3cSopenharmony_ciFN("memory(KiB)", RLIMIT_VMEM, 1024 104c84f3f3cSopenharmony_ci 105c84f3f3cSopenharmony_ci>v|ULIMIT_V_IS_VMEM 106c84f3f3cSopenharmony_ciFN("virtual-memory(KiB)", RLIMIT_VMEM, 1024 107c84f3f3cSopenharmony_ci>v|ULIMIT_V_IS_AS 108c84f3f3cSopenharmony_ciFN("address-space(KiB)", RLIMIT_AS, 1024 109c84f3f3cSopenharmony_ci 110c84f3f3cSopenharmony_ci>x|RLIMIT_LOCKS 111c84f3f3cSopenharmony_ciFN("filelocks", RLIMIT_LOCKS, 1 112c84f3f3cSopenharmony_ci 113c84f3f3cSopenharmony_ci|RLIMITS_OPTCS 114