xref: /aosp_15_r20/external/mksh/src/rlimits.opt (revision 7c356e860f31eadd15fd599fcfdb9fd21f16a9d4)
1/*-
2 * Copyright (c) 2013, 2015, 2019
3 *	mirabilos <[email protected]>
4 *
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.
10 *
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.
19 *-
20 * Keep {r,u}limits.opt in sync with each other!
21 */
22
23@RLIMITS_DEFNS
24__RCSID("$MirOS: src/bin/mksh/rlimits.opt,v 1.5 2020/07/24 20:11:18 tg Exp $");
25@RLIMITS_ITEMS
26#define FN(lname,lid,lfac,lopt) (const struct limits *)(&rlimits_ ## lid),
27@@
28
29/* generic options for the ulimit builtin */
30
31<a|
32<H|
33<S|
34
35/* do not use options -H, -S or -a or change the order */
36
37>t|RLIMIT_CPU
38FN("time(cpu-seconds)", RLIMIT_CPU, 1
39
40>f|RLIMIT_FSIZE
41FN("file(blocks)", RLIMIT_FSIZE, 512
42
43>c|RLIMIT_CORE
44FN("coredump(blocks)", RLIMIT_CORE, 512
45
46>d|RLIMIT_DATA
47FN("data(KiB)", RLIMIT_DATA, 1024
48
49>s|RLIMIT_STACK
50FN("stack(KiB)", RLIMIT_STACK, 1024
51
52>l|RLIMIT_MEMLOCK
53FN("lockedmem(KiB)", RLIMIT_MEMLOCK, 1024
54
55>n|RLIMIT_NOFILE
56FN("nofiles(descriptors)", RLIMIT_NOFILE, 1
57
58>p|RLIMIT_NPROC
59FN("processes", RLIMIT_NPROC, 1
60
61>w|RLIMIT_SWAP
62FN("swap(KiB)", RLIMIT_SWAP, 1024
63
64>T|RLIMIT_TIME
65FN("humantime(seconds)", RLIMIT_TIME, 1
66
67>V|RLIMIT_NOVMON
68FN("vnodemonitors", RLIMIT_NOVMON, 1
69
70>i|RLIMIT_SIGPENDING
71FN("sigpending", RLIMIT_SIGPENDING, 1
72
73>q|RLIMIT_MSGQUEUE
74FN("msgqueue(bytes)", RLIMIT_MSGQUEUE, 1
75
76>M|RLIMIT_AIO_MEM
77FN("AIOlockedmem(KiB)", RLIMIT_AIO_MEM, 1024
78
79>O|RLIMIT_AIO_OPS
80FN("AIOoperations", RLIMIT_AIO_OPS, 1
81
82>C|RLIMIT_TCACHE
83FN("cachedthreads", RLIMIT_TCACHE, 1
84
85>B|RLIMIT_SBSIZE
86FN("sockbufsiz(KiB)", RLIMIT_SBSIZE, 1024
87
88>P|RLIMIT_PTHREAD
89FN("threadsperprocess", RLIMIT_PTHREAD, 1
90
91>r|RLIMIT_THREADS
92FN("threadsperprocess", RLIMIT_THREADS, 1
93
94>e|RLIMIT_NICE
95FN("maxnice", RLIMIT_NICE, 1
96
97>r|RLIMIT_RTPRIO
98FN("maxrtprio", RLIMIT_RTPRIO, 1
99
100>m|ULIMIT_M_IS_RSS
101FN("resident-set(KiB)", RLIMIT_RSS, 1024
102>m|ULIMIT_M_IS_VMEM
103FN("memory(KiB)", RLIMIT_VMEM, 1024
104
105>v|ULIMIT_V_IS_VMEM
106FN("virtual-memory(KiB)", RLIMIT_VMEM, 1024
107>v|ULIMIT_V_IS_AS
108FN("address-space(KiB)", RLIMIT_AS, 1024
109
110>x|RLIMIT_LOCKS
111FN("filelocks", RLIMIT_LOCKS, 1
112
113|RLIMITS_OPTCS
114