bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make check fails on Mac OS X 10.4 (Tiger) with coreutils 5.3.0


From: Paul Eggert
Subject: Re: make check fails on Mac OS X 10.4 (Tiger) with coreutils 5.3.0
Date: Sun, 29 May 2005 15:54:14 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Benjamin Reed <address@hidden> writes:

> ranger$ /sw/bin/nice.gnu -12 /sw/bin/nice.gnu
> 1
> ranger$ /usr/bin/nice -12 /sw/bin/nice.gnu
> 12

OK, so the GNU "nice" isn't setting niceness appropriately.

What is the value of NICE_PRIORITY in config.h?
I'll assume it's not defined, so here's the relevant code:

  current_nice_value = GET_NICE_VALUE ();
  if (current_nice_value == -1 && errno != 0)
    error (EXIT_FAIL, errno, _("cannot get priority"));
  ok = (setpriority (PRIO_PROCESS, 0, current_nice_value + adjustment) == 0);

This code was traced as follows:

>    559 nice.gnu CALL  getpriority(0,0)
>    559 nice.gnu RET   getpriority 0
>    559 nice.gnu CALL  setpriority(0,0,0x1)
>    559 nice.gnu RET   setpriority 0

>From this I conclude that "adjustment" is 1 when you invoke
"src/nice -12 something".  Can you verify this with a debugger
or with an inserted printf?

If "adjustment" is 1, then the culprit is most likely in this code in
src/nice.c:

      enum { MIN_ADJUSTMENT = 1 - 2 * NZERO, MAX_ADJUSTMENT = 2 * NZERO - 1 };
      long int tmp;
      if (LONGINT_OVERFLOW < xstrtol (adjustment_given, NULL, 10, &tmp, ""))
        error (EXIT_FAIL, 0, _("invalid adjustment `%s'"), adjustment_given);
      adjustment = MAX (MIN_ADJUSTMENT, MIN (tmp, MAX_ADJUSTMENT));

Can you please let us know the values of tmp, NZERO, MIN_ADJUSTMENT,
and MAX_ADJUSTMENT?  The easiest way to do this is perhaps to insert a
printf here.

Thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]