Re: Request for testing - top 3.8b1 in the base system

From: pluknet <pluknet_at_gmail.com>
Date: Tue, 21 Oct 2008 20:30:33 +0400
2008/9/29 Jaakko Heinonen <jh_at_saunalahti.fi>:
> On 2008-09-28, Edwin Groothuis wrote:
>> > Swap:   3000M Total, 181M Used, 2819M Free, 6% Inuse
>> >  sysctlnametomib: No such file or directory
>> >
>> > And no processes.
>>
>> I didn't expect it not to work on 6.x, I will play around with it
>> tomorrow to see if it makes sense.
>
> According to svn log kern.cp_times sysctl was added in r174070 and MFCd
> after 6.3/7.0 release.
>

As a simple workaround:
Index: top/freebsd-top-3.8b1-A/usr.bin/top/machine.c
===================================================================
--- top/freebsd-top-3.8b1-A/usr.bin/top/machine.c       (revision 5702)
+++ top/freebsd-top-3.8b1-A/usr.bin/top/machine.c       (working copy)
_at__at_ -513,6 +513,12 _at__at_
     while (mp->name != NULL)
     {
        len = MAXMIBLEN;
+#if __FreeBSD_version < 604000
+       if (!strcmp(mp->name, "kern.cp_times")) {
+           mp++;
+           continue;
+        }
+#endif
        if (sysctlnametomib(mp->name, mp->mib, &len) == -1)
        {
            message_error(" sysctlnametomib: %s", strerror(errno));
-- 
wbr,
pluknet
_______________________________________________
freebsd-stable_at_freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe_at_freebsd.org"
Received on Tue Oct 21 2008 - 14:52:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:36 UTC