NetBSD Problem Report #31017
From www@netbsd.org Sat Aug 20 02:36:11 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
id CD06763B117; Sat, 20 Aug 2005 02:36:11 +0000 (UTC)
Message-Id: <20050820023611.CD06763B117@narn.netbsd.org>
Date: Sat, 20 Aug 2005 02:36:11 +0000 (UTC)
From: segv@netctl.net
Reply-To: segv@netctl.net
To: gnats-bugs@netbsd.org
Subject: sysutils/xfce4-systemload-plugin displays incorrect amount of physical RAM on sparc64
X-Send-Pr-Version: www-1.0
>Number: 31017
>Category: pkg
>Synopsis: sysutils/xfce4-systemload-plugin displays incorrect amount of physical RAM on sparc64
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: martti
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Aug 20 02:37:00 +0000 2005
>Closed-Date: Wed Sep 14 11:56:42 +0000 2005
>Last-Modified: Wed Sep 14 11:56:42 +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:/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;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->martti
Responsible-Changed-By: reed@netbsd.org
Responsible-Changed-When: Sat, 20 Aug 2005 04:52:27 +0000
Responsible-Changed-Why:
Assigned to maintainer.
State-Changed-From-To: open->closed
State-Changed-By: martti@netbsd.org
State-Changed-When: Wed, 14 Sep 2005 11:56:42 +0000
State-Changed-Why:
Committed, thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.