Jim Meyering wrote:
> "Peter O'Gorman" <[EMAIL PROTECTED]> wrote:
>> I seem to have lost Jim's reply, but here is a patch. Works on
>> aix-4.3.3 and aix-5.3.
>>
>> The SBITS thing is the way the libperstat.h header recommends
>> calculating the loadavg:
>>
>> /* To calculate the load average, divide the numbers by (1<<SBITS). SBITS is
>> defined in <sys/proc.h>. */
>>
>> Of course, it is not defined on aix4.3.3 ...
>
> Hi Peter,
>
> Here's an incremental diff.
> Most changes are syntactic, but I did eliminate an #if block
> by moving the static declaration of cpu_stats into the
> block that uses that variable. I also removed some casts.
>
> FYI, I realize you were just retaining the existing style,
> but I'd rather begin the process of moving toward less
> syntax (removing parentheses around cpp symbols), at least
> on most of the lines touched by this change.
>
> If you can confirm that this works, I'll write
> the ChangeLog and check in the combined change set.
This works (tested on aix4.3.3, aix5.1, 5.2 and 5.3).
I suppose a possible ChangeLog would be:
2008-02-05 Peter O'Gorman <[EMAIL PROTECTED]>,
Jim Meyering <[EMAIL PROTECTED]>
* lib/getloadavg.c, m4/getloadavg.m4 [aix]: Use libperfstat.
Thank you,
Peter