From c3a8ef7034fb2bc02f35381a8970ac026822a810 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 9 Nov 2025 18:32:14 +0100 Subject: s6-softlimit: add -P option for RLIMIT_RTPRIO Bash ulimit uses -r for this, but in s6-softlimit that was already taken. I could have used -R, but Bash uses that for RLIMIT_RTTIME, so I didn't want to claim that one and create a similarly difficult decision for somebody adding that in future. I decided to use -P (for "priority") as the least bad still-available option. --- src/daemontools-extras/s6-softlimit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/daemontools-extras/s6-softlimit.c') diff --git a/src/daemontools-extras/s6-softlimit.c b/src/daemontools-extras/s6-softlimit.c index d6112b2..beb7325 100644 --- a/src/daemontools-extras/s6-softlimit.c +++ b/src/daemontools-extras/s6-softlimit.c @@ -41,7 +41,7 @@ int main (int argc, char const *const *argv) PROG = "s6-softlimit" ; for (;;) { - int opt = subgetopt_r(argc, argv, "hHa:c:d:f:l:m:o:p:r:s:t:", &l) ; + int opt = subgetopt_r(argc, argv, "hHa:c:d:f:l:m:o:P:p:r:s:t:", &l) ; if (opt == -1) break ; switch (opt) { @@ -103,6 +103,11 @@ int main (int argc, char const *const *argv) case 'p' : #ifdef RLIMIT_NPROC doit(RLIMIT_NPROC, l.arg) ; +#endif + break ; + case 'P' : +#ifdef RLIMIT_RTPRIO + doit(RLIMIT_RTPRIO, l.arg) ; #endif break ; case 'r' : -- cgit v1.3.1