Introduction and About libgtop and Gnome

LibGTop is a library that fetches system related information such as CPU load, memory usage and information about running processes (see the Release notes for LibGTop 1.0 for more information about this).

LibGTop is designed to be as portable as possible. None of the functions and retrieved information should be specific to a specific operating system. So you only need to port the system dependent part of the library to a new system and all application programs can then use LibGTop on this new system.
Client/Server model
Some systems like DEC OSF/1 or BSD require special privileges for the calling process to fetch the required information (SUID root/SGID kmem). To solve this problem, I designed a client/server model which makes a call to a SUID/SGID server which fetches the required information whenever it is required. This server is only called for features that really require privileges, otherwise the sysdeps code is called directory (every user can get the CPU usage on DEC OSF/1, but only root can get information about processes other than the current one). There is also some kind of daemon which can be used to fetch information from remote systems (still experimental). This daemon normally runs as nobody and calls the SUID/SGID itself when needed.
LibGTop and Gnome
LibGTop is currently used in various places in the GNOME Project, for instance in some of the applets in gnome-core and - of cause - this ultra-cool application called GTop ... Although LibGTop is not specific to GNOME and under LGPL license, I spent most my time during the last months to work in the GNOME project so this is the primary use for LibGTop (and currently the only one). However, you can also give its configure script the --without-gnome parameter and then use it fully without GNOME in your own applications. LibGTop was tested with FreeBSD 3.0 but it should also work with FreeBSD 2.2.7, NetBSD and OpenBSD. Currently my primary aim is to help the GNOME people with our 1.0 release so I won't have much time to test it with any other system than Linux. However, I consider FreeBSD, NetBSD and OpenBSD as supported systems for LibGTop and whenever I get bug reports I will do my best to fix them as quickly as possible.

Installation of libgtop

Install libgtop by running the following commands: _______________________________________________________ ./configure --prefix=/usr --disable-static && make _______________________________________________________ This package does not come with a test suite. Now, as the root user: _______________________________________________________ make install _______________________________________________________
Command Explanations

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-gtk-doc: Use this parameter if GTK-Doc is installed and you wish to rebuild and install the API documentation.

libgtop Dependencies

Required: GLib-2.52.3 and Xorg Libraries
Recommended: gobject-introspection-1.52.1

Server Implementation: The LibGTop "server"

The LibGTop @dfn{server} is a setgid/setuid binary which contains all the system dependent code which needs special privileges. It is only build if it's required on the current system (for instance, the Linux kernel provides all the required data via its @file{/proc} filesystem so we do not need the server at all) and it only contains the @dfn{features} which need privileges.

Whenever we do not need any privileges to get all the data for some of the requested structures (here called @dfn{features}) the library calls the sysdeps code directly rather than using the server.