Bug 42028 - [patch] devel/libgtop2 displays wrong swap-info
Summary: [patch] devel/libgtop2 displays wrong swap-info
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-26 11:40 UTC by edwin
Modified: 2002-08-26 16:37 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (434 bytes, patch)
2002-08-26 11:40 UTC, edwin
no flags Details | Diff
file.diff (275 bytes, patch)
2002-08-26 11:40 UTC, edwin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description edwin 2002-08-26 11:40:04 UTC
libgtop2 provides an API between GTK+ applications and the kernel-structures.
It returns swap-information, but forgets to multiple it by getpagesize().

Fix: Add this file as files/patch-sysdeps::freebsd::swap.c
How-To-Repeat: 
Install sysutils/gnomesystemsmonitor and check the swap-size.
Or run this:

#include <stdio.h>
#include <glibtop.h>
#include <glibtop/swap.h>

void swap(void) {
        glibtop_swap swap;

	glibtop_get_swap(&swap);
	printf("SWAP\n");
	printf("total: %lld\n",swap.total);
	printf("used : %lld\n",swap.used );
	printf("free : %lld\n",swap.free );
}

int main(void) {
        glibtop_init();
	swap();
}

gcc -Wall -I/usr/local/include/libgtop-2.0 -L/usr/local/lib -o a a.c -lgtop-2.0 -lgtop_common-2.0 -lgtop_suid_common-2.0 -lgtop_sysdeps-2.0 -lgtop_names-2.0 -lgtop_sysdeps_suid-2.0 && ./a
Comment 1 Oliver Braun freebsd_committer freebsd_triage 2002-08-26 11:43:00 UTC
Responsible Changed
From-To: freebsd-ports->gnome

Over to maintainer(s).
Comment 2 Joe Marcus Clarke freebsd_committer freebsd_triage 2002-08-26 16:37:03 UTC
State Changed
From-To: open->closed

Committed, thanks!