On 24/08/2025 10:56, Collin Funk wrote:
Bruno Haible via GNU coreutils Bug Reports <bug-coreutils@gnu.org>
writes:
Today's CI run produces a
FAIL: tests/nproc/nproc-quota
on CentOS 7 and on Alpine Linux.
Here are the two relevant log file portions.
Thanks. The Alpine one fails because sched_getscheduler is a stub that
always fails. I'm fine with just skipping that one with the attached
patch. This causes cpu_quota to always return ULONG_MAX.
Right. I think the general approach is to wrap sched_getscheduler()
which gives us more control, and more testing too.
I've pushed https://github.com/coreutils/coreutils/commit/4bfcf62f7
to implement such a wrapper.
The CentOS 7 one fails because SCHED_DEADLINE is not defined by
sched.h. But it is defined in linux/sched.h. The second patch, which is
for Gnulib, fixed it in my CentOS 7 container.
Well it does with the simulated cgroup info in proc,
but in practice nproc quotas will not be effective on such old systems
as they'll be cgroups v1 and thus not be supported anyway.
The pushed sched_getscheduler() wrapper should not build
on such older / non linux systems, and thus the test
will be skipped for them.
Thanks for looking at this.
Padraig