[Toybox] [PATCH] Add uclampset(1).

Rob Landley rob at landley.net
Fri Dec 10 06:52:59 PST 2021


On 12/9/21 7:31 PM, enh via Toybox wrote:
> No standard, but part of util-linux.

Don't default y in pending.

USE_TASKSET(NEWTOY(uclampset)) doesn't match.

Does this require root?

>From a UI perspective, do we ever _not_ want -a?

Sigh. It's HARD to come up with a good terse description of -R.

$ grep syscall\.h toys/*/*.c
toys/other/chrt.c:#include <sys/syscall.h>
toys/other/insmod.c:#include <sys/syscall.h>
toys/other/ionice.c:#include <sys/syscall.h>
toys/other/nsenter.c:#include <sys/syscall.h>
toys/other/pivot_root.c:#include <sys/syscall.h>
toys/other/readahead.c:#include <sys/syscall.h>
toys/other/rmmod.c:#include <sys/syscall.h>
toys/other/taskset.c:#include <sys/syscall.h>
toys/pending/modprobe.c:#include <sys/syscall.h>
toys/pending/strace.c:#include <sys/syscall.h>
toys/pending/uclampset.c:#include <sys/syscall.h>

Is there a reason we haven't got sys/syscall.h in toys.h? Sure, it's not in
posix but it apparently originated in BSD:

https://www.freebsd.org/cgi/man.cgi?query=syscall&sektion=2&format=html

So the header should at least _exist_ there, and including it not break the build?

Ah. My devauan kernel is 4.19+fixes, so this goes boing when I run it. Luckily,
I created mkroot... Hmmm... Except when I tried your version (without any of my
changes), it still went:

Type exit when done.
# uclampset
uclampset: Need -p PID or CMD [ARG...]
# uclampset -p $$
sh (48) util_clamp: min: 0 max: 0
# uclampset -p $$ -m 42
uclampset: sched_setattr for pid 48: Not supported
# uclampset -p $$ -M 42
uclampset: sched_setattr for pid 48: Not supported
# cat /proc/version
Linux version 5.16.0-rc3 (landley at driftwood) (x86_64-linux-musl-gcc (GCC) 9.2.01

Do I need a kernel config entry or something?

Rob



More information about the Toybox mailing list