[Toybox] [PATCH] taskset: fix buffer overflow from long mask
Jesse Rosenstock
jmr at google.com
Wed Aug 27 01:00:57 PDT 2025
On Mon, Aug 4, 2025 at 7:58 PM Rob Landley <rob at landley.net> wrote:
> I initially didn't use this because:
>
> $ ps -o PSR $$
> error: unknown user-defined format specifier "PSR"
It looks like case-insensitive output formats might be a toybox thing.
macOS and procps-ng don't support it.
I have a patch to use ps -o psr= in taskset.test. Let me know if it's
worth sending. Here's the gist of it:
testing 'run on first' \
- 'X=$(taskset 1 cat /proc/self/stat); x() { echo ${39};}; x $X' \
- '0\n' '' ''
+ 'taskset 1 bash -c "ps -o psr= \$\$" | sed "s/^ *//"' '0\n' '' ''
procps-ng now knows about `-o cpu`:
https://gitlab.com/procps-ng/procps/-/commit/fb33dfb6e5ebd7154d457b76996679df76909dbb
More information about the Toybox
mailing list