pkgsrc-Bugs archive

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

pkg/31017: sysutils/xfce4-systemload-plugin displays incorrect amount of physical RAM on sparc64



>Number:         31017
>Category:       pkg
>Synopsis:       sysutils/xfce4-systemload-plugin displays incorrect amount of 
>physical RAM on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 20 02:37:00 +0000 2005
>Originator:     segv
>Release:        3.99.7
>Organization:
>Environment:
NetBSD dhcli-192-168-0-5.netctl.net 3.99.7 NetBSD 3.99.7 (GENERIC) #0: Thu Aug 
18 21:14:58 BST 2005  
roman%dhcli-192-168-0-3.netctl.net@localhost:/opt/obj.sparc64/sys/arch/sparc64/compile/GENERIC
 sparc64
>Description:
sysutils/xfce4-systemload-plugin is a plugin for xfce4 window manager, it 
displays CPU load, RAM and swap usage. On sparc64 port, it displays incorrect 
amount of physical RAM.
>How-To-Repeat:

>Fix:
Apply the following patch:

--- panel-plugin/memswap.c.orig 2003-11-06 00:39:52.000000000 +0000
+++ panel-plugin/memswap.c      2005-08-20 03:18:07.000000000 +0100
@@ -284,7 +284,17 @@
 
 #define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
     {
-        static int mib[]={ CTL_HW, HW_PHYSMEM };
+       static int mib[2];
+       /* 64-bit datatype */
+       if(sizeof(size_t) == 8) {
+               mib[0] = CTL_HW;
+               mib[1] = HW_PHYSMEM64;
+       }
+       /* assume 32-bit datatype */
+       else {
+               mib[0] = CTL_HW;
+               mib[1] = HW_PHYSMEM;
+       }
         len = sizeof(MTotal);
         sysctl(mib, ARRLEN(mib), &MTotal, &len, NULL, 0);
         MTotal >>= 10;
@@ -395,7 +405,17 @@
 
 #define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
     {
-        static int mib[]={ CTL_HW, HW_PHYSMEM };
+       static int mib[2];
+       /* 64-bit datatype */
+       if(sizeof(size_t) == 8) {
+               mib[0] = CTL_HW;
+               mib[1] = HW_PHYSMEM64;
+       }
+       /* assume 32-bit datatype */
+       else {
+               mib[0] = CTL_HW;
+               mib[1] = HW_PHYSMEM;
+       }
         len = sizeof(MTotal);
         sysctl(mib, ARRLEN(mib), &MTotal, &len, NULL, 0);
         MTotal >>= 10;




Home | Main Index | Thread Index | Old Index