cgroup constraints are a popular mechanism on linux. I was thinking of augmenting the nproc routines to incorporate cgroup cpu constraints for NPROC_CURRENT_OVERRIDABLE so that we'd return MIN(cgroup constraint, current value);
The cgroup constraint would be inferred from: cat $(findmnt -n -t cgroup2 -o target)/$(cut -d: -f3- < /proc/self/cgroup)/cpu.max though the C will be a bit more involved of course :) I'll look at doing this soon, unless there are other opinions. cheers, Padraig
