|
From: | Pádraig Brady |
Subject: | Re: I: coreutils tests/misc/nproc-avail fails on GNU/Linux without /proc and /sys mounted |
Date: | Sun, 10 Jan 2010 11:02:57 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 |
On 10/01/10 10:32, Bruno Haible wrote:
Pádraig Brady wrote:So what about a possible work around? How about doing this in nproc(1): if (num_processors(NPROC_ALL) == 1) return num_processors(NPROC_CURRENT_OVERRIDABLE)It should be NPROC_CURRENT, not NPROC_CURRENT_OVERRIDABLE, I think, because NPROC_CURRENT_OVERRIDABLE can be overridden by the user quite arbitrarily.
oops, right.
I like this workaround, but would prefer to have it in the nproc module in gnulib. coreutils/src/nproc.c is purely the command-line program.
I was wary about adding a syscall for all users of num_processors(NPROC_ALL), but on consideration I agree that it's best to add to gnulib.
Here's a proposed patch.
Looks good. thanks! Pádraig.
[Prev in Thread] | Current Thread | [Next in Thread] |