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