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.


Reply via email to