Compare commits

..

508 Commits

Author SHA1 Message Date
Martin Baulig
d5c8af57f3 1.1.0. 1999-05-31 14:04:43 +00:00
Drazen Kacar
deeadb6648 Fixed bug in calculation of process argument list.
* procargs.c: Fixed bug in calculation of process argument list.
1999-05-30 20:39:07 +00:00
Martin Baulig
f8f0ee6882 Added "Servers and Daemons" section. Documented the glibtop_init ()
* white-papers.texi: Added "Servers and Daemons" section.
* reference.texi: Documented the glibtop_init () function.
1999-05-28 22:43:58 +00:00
Martin Baulig
76be244662 New file documenting LibGTop internals. Started to document all library
1999-05-28  Martin Baulig  <baulig@Stud.Informatik.Uni-Trier.DE>

	* internals.texi: New file documenting LibGTop internals.
	* reference.texi: Started to document all library functions and
	finished the sysdeps and common references.
1999-05-28 17:14:02 +00:00
Martin Baulig
d97a151695 Remove the GLIBTOP_SYSDEPS_FEATURES' and GLIBTOP_SYSDEPS_POINTER_SIZE'
1999-05-28  Martin Baulig  <baulig@Stud.Informatik.Uni-Trier.DE>

	* include/glibtop/sysdeps.h: Remove the `GLIBTOP_SYSDEPS_FEATURES'
	and `GLIBTOP_SYSDEPS_POINTER_SIZE' constants and let numbering
	start at zero for `GLIBTOP_SYSDEPS_CPU'.
1999-05-28 16:38:20 +00:00
Martin Baulig
c9dfc76155 *** empty log message *** 1999-05-28 13:31:53 +00:00
Martin Baulig
506023c898 Finished the LibGTop Reference Manual. 1999-05-28 12:46:25 +00:00
Martin Baulig
0e9245ba28 Move this here.
1999-05-28  Martin Baulig  <martin@home-of-linux.org>

	* glibtop.h (GLIBTOP_MOUNTENTRY_LEN): Move this
	* include/glibtop/limits.h: here.
1999-05-28 12:01:56 +00:00
Martin Baulig
091811a4d6 Added note about NetBSD 1.4 which is now supported. 1999-05-28 11:43:59 +00:00
Martin Baulig
18f4bccb37 *** empty log message *** 1999-05-28 00:09:32 +00:00
Martin Baulig
37af4964cc Add main.texi to libgtop_TEXINFOS. 1999-05-27 23:58:45 +00:00
Martin Baulig
f248d99d7a Minor Alpha fixes (merged from stable). 1999-05-27 23:15:56 +00:00
Martin Baulig
ca80d88a74 *** empty log message *** 1999-05-27 22:26:41 +00:00
Martin Baulig
56765d966f Use LibGTop version conditionals so we can more easily merge the code into
1999-05-28  Martin Baulig  <martin@home-of-linux.org>

	* first.c, second.c: Use LibGTop version conditionals so we can
	more easily merge the code into LIBGTOP_STABLE_1_0.
1999-05-27 22:25:43 +00:00
Martin Baulig
d169afcafa glibtop_get_proc_data_proc_args_s () returns -1 on failure. 1999-05-27 22:19:55 +00:00
Drazen Kacar
1f4b738639 Get the file name from inode number.
* glibtop_machine.h, open.c, procmap.c: Get the file name
        from inode number.
1999-05-27 02:57:34 +00:00
Martin Baulig
981668a56b *** empty log message *** 1999-05-26 15:33:57 +00:00
Martin Baulig
b55257d0d3 Make this work with NetBSD 1.4. 1999-05-26 15:32:59 +00:00
Martin Baulig
ae6f746cf2 Small fix to print correct warnings/errors. 1999-05-26 15:30:36 +00:00
Martin Baulig
68e7b7a1d4 Removed debugging statement. 1999-05-26 15:28:58 +00:00
Martin Baulig
7b7071cf6d Only #include <sys/param.h> inside LibGTop. 1999-05-26 15:28:27 +00:00
Martin Baulig
b1e908e6b6 More NetBSD 1.4 fixes.
1999-05-26  Martin Baulig  <martin@home-of-linux.org>

	More NetBSD 1.4 fixes.

	* mem.c, procmap.c, procmem.c: Make this work with the new UVM code.

	[FIXME: This following most likely works on all BSD systems, but
	this needs to be tested; I made it conditional to NetBSD 1.4 at
	the moment. Please extend the conditionals to any other systems
	where this works ...]

	* procstate.c: Added `ruid' and `rgid' for LibGTop >= 1.1.0.
	* procuid.c: Added `ngroups' and `groups' for LibGTop >= 1.1.0.
1999-05-26 13:21:19 +00:00
Martin Baulig
f91050a7c7 Define `LIBGTOP_VERSION_CODE' here so we can use version conditionals in
1999-05-26  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (INCLUDES): Define `LIBGTOP_VERSION_CODE' here so we
	can use version conditionals in the sysdeps code.
1999-05-26 13:16:38 +00:00
Martin Baulig
e3f9aa526b *** empty log message *** 1999-05-25 18:11:14 +00:00
Martin Baulig
7db0c756d6 First attempt at making this work on NetBSD 1.4. 1999-05-25 18:09:27 +00:00
Martin Baulig
c1bd844673 Make I4B work on NetBSD. 1999-05-25 17:25:29 +00:00
Drazen Kacar
914354adb2 automake.die.die.die 1999-05-21 21:25:35 +00:00
Martin Baulig
2ac4fb92c2 Added netload. 1999-05-21 18:36:17 +00:00
Martin Baulig
0c1dd954eb Added proc_map. 1999-05-21 18:27:14 +00:00
Martin Baulig
116767b8b8 Added proc_args. 1999-05-21 18:14:30 +00:00
Martin Baulig
3eb5394474 Re-arranged the reference manual a bit: put everything into subsections, not
sections and sort them by "System Dependent Function", "Common Functions" etc.
1999-05-21 18:03:33 +00:00
Martin Baulig
953f59195f Some more work on the LibGTop white paper. 1999-05-21 17:38:30 +00:00
Martin Baulig
309f3998d7 Added some things from the old reference manual. 1999-05-21 15:24:12 +00:00
Martin Baulig
887c4013a0 Made that "dc" think a bit more clean. 1999-05-21 08:19:28 +00:00
Drazen Kacar
f232ddcdcb Implemented what Solaris has to offer cheaply. It sucks, but digging in
* procargs.c: Implemented what Solaris has to offer cheaply.
        It sucks, but digging in process address space would be
        too slow.
1999-05-17 16:37:38 +00:00
Martin Baulig
bd0424ee7d *** empty log message *** 1999-05-16 17:32:08 +00:00
Martin Baulig
62824e1537 Use conditionals for glibtop_cpu. 1999-05-16 17:25:58 +00:00
Martin Baulig
36e7d3133b TeX doesn't like conditionals with underscores in it - so we need to
use `LIBGTOP-1-1' here.
1999-05-16 17:25:24 +00:00
Martin Baulig
20c69951ab *** empty log message *** 1999-05-16 14:49:43 +00:00
Martin Baulig
d9d8cdf043 This is now the main file which will @include all chapter files so we can
1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* main.texi: This is now the main file which will @include all
	chapter files so we can use `texinfo-multiple-files-update'.

	* reference.texi: Added all missing sections with a "not yet written"
	notice.
1999-05-16 14:48:58 +00:00
Martin Baulig
29fba02b4a This directory is shared between the HEAD and the LIBGTOP_STABLE_1_0
branch (`LIBGTOP_STABLE_1_0' is just an ordinary tag and no branch tag
here).

Whenever we make a new release of LibGTop 1.0.x, we'll move that tag to
point to a "stable" version of the documentation.

May 16, 1999
Martin Baulig
1999-05-16 14:48:38 +00:00
Martin Baulig
1954718e3f This is now the main file which will @include all chapter files so we can
1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* main.texi: This is now the main file which will @include all
	chapter files so we can use `texinfo-multiple-files-update'.

	* reference.texi: Added all missing sections with a "not yet written"
	notice.
1999-05-16 13:44:11 +00:00
Martin Baulig
6712cae260 Added title page, table of contents etc. 1999-05-16 13:34:05 +00:00
Martin Baulig
6ddf213d5d Initial version of the LibGTop White Paper.
1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* white-paper.texi: Initial version of the LibGTop White Paper.
1999-05-16 13:33:40 +00:00
Martin Baulig
b700a17efa texi2dvi doesn't like @clear for some reason. 1999-05-16 12:50:31 +00:00
Martin Baulig
bedec591a2 We can't call that file `version.texi' since that's some king of "magic"
name for automake, so I renamed it to `auto-macros.texi'.

1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Create `auto-macros.texi' from `auto-macros.texi.in'
 	which will contain some `@set' commands for the LibGTop version etc.

	* auto-macros.texi.in: New file. This is a template for
	`auto-macros.texi' which will be automatically generated.
1999-05-16 12:31:58 +00:00
Martin Baulig
2c4568119c Create version.texi' from version.texi.in' which will contain some
1999-05-16  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Create `version.texi' from `version.texi.in' which
	will contain some `@set' commands for the LibGTop version etc.

	* version.texi.in: New file. This is a template for `version.texi'
	which will be generated from Makefile.am.
1999-05-16 12:18:00 +00:00
Martin Baulig
efd8e2f343 *** empty log message *** 1999-05-16 11:42:33 +00:00
Martin Baulig
f29793c868 *** empty log message *** 1999-05-16 10:30:34 +00:00
Martin Baulig
e8bbb15f7e Remove the `--enable-hacker-mode' requirement for the BSDI, Solaris and
1999-05-15  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4: Remove the `--enable-hacker-mode' requirement
	for the BSDI, Solaris and Digital Unix ports.
1999-05-15 19:44:36 +00:00
Martin Baulig
fdb2e5eb7b *** empty log message *** 1999-05-13 13:39:27 +00:00
Martin Baulig
da58e7edb4 Define this on Solaris; we use version codes like 270 for SunOS 5.7 and
1999-05-13  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4 (GLIBTOP_SOLARIS_RELEASE): Define this on Solaris;
	we use version codes like 270 for SunOS 5.7 and 251 for SunOS 2.5.1.
1999-05-13 13:00:35 +00:00
Martin Baulig
e81b8ba479 *** empty log message *** 1999-05-12 14:43:01 +00:00
Martin Baulig
cfbe553724 This is a new generated file which will be included from <glibtop.h>. We
1999-05-12  Martin Baulig  <martin@home-of-linux.org>

	* glibtop-config.h: This is a new generated file which will be
	included from <glibtop.h>. We define things like `u_int64_t' and
	LIBGTOP_*_VERSION here so we can compile LibGTop applications with
	`libgtop-config --cflags`.

	* configure.in: Create glibtop-config.h.
	(GLIBTOP_*_INCS): Added `-I $(pkglibdir)/include'.

	* libgtop-config.h.in: Added `--cflags', `--libs' and `--extra-libs'
	parameter so you can now use LibGTop even in no-autoconf apps.

	* Makefile.am: Install `glibtop-config.h' in `$(pkglibdir)/include'.
1999-05-12 10:25:33 +00:00
Martin Baulig
17634e05d4 *** empty log message *** 1999-05-12 08:29:33 +00:00
Martin Baulig
7d216d364e Added proc_mem. 1999-05-11 13:15:50 +00:00
Martin Baulig
9e16f6e88c Fixed implementation of the state' field; added ruid' and `rgid' fields.
1999-05-11  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c: Fixed implementation of the `state' field; added
	`ruid' and `rgid' fields.
1999-05-11 12:56:50 +00:00
Drazen Kacar
f23e8b3d1c Return 0 usage times for scheaduler (PID 0).
* proctime.c: Return 0 usage times for scheaduler (PID 0).
1999-05-11 06:25:04 +00:00
Drazen Kacar
04d988357f Another try to match Linux process states. Why am I doing it? 1999-05-11 06:11:46 +00:00
Martin Baulig
14ed950dad *** empty log message *** 1999-05-10 11:05:33 +00:00
Martin Baulig
f107c34f82 Added proc_uid. 1999-05-10 11:02:59 +00:00
Martin Baulig
9b5bfd33ef *** empty log message *** 1999-05-10 09:30:52 +00:00
Martin Baulig
8fc6c79b6d Added proc_state. 1999-05-10 09:30:27 +00:00
Drazen Kacar
2d838b9f09 Forgot to commit. 1999-05-10 06:01:52 +00:00
Drazen Kacar
c1649507e9 Added process selection mechanism. It's not included in Solaris 2.5 build,
* proclist.c: Added process selection mechanism. It's not
        included in Solaris 2.5 build, since we first have to decide
        what will be dispatched to daemon.
1999-05-10 05:44:52 +00:00
Drazen Kacar
a246a6390f There be some useful documentation now. Syncing...
* mem.c: Output values in bytes, as the documentation requires.
        It was a bit odd when gtop reported 256K of total memory.
1999-05-09 22:38:16 +00:00
Drazen Kacar
6a9317238a Typoo fix. 1999-05-09 21:56:52 +00:00
Drazen Kacar
0a45542477 Added checks for <procfs.h> and <sys/procfs.h>
* configure.in, acconfig.h: Added checks for <procfs.h>
        and <sys/procfs.h>
1999-05-09 20:29:56 +00:00
Drazen Kacar
03be66c857 Initial Solaris 2.5 port. It's far from being complete and hasn't been
* glibtop_machine.h, procdata.c, proclist.c, procmap.c, procmem.c,
        procsignal.c, procstate.c, procuid.c, open.c, mem.c: Initial
        Solaris 2.5 port. It's far from being complete and hasn't been
        tested properly. We'll need setuid root daemon, which is
        currently not implemented. #ifdef symbols to check are
        HAVE_PROCFS_H and KSTAT_DATA_UINT32. These will be defined on
        Solaris 2.6 and later, but not on earlier releases.
1999-05-09 20:27:43 +00:00
Martin Baulig
777c371be9 Added proclist. 1999-05-09 15:53:42 +00:00
Martin Baulig
d8bb202fbd Added information about the library function. 1999-05-09 15:33:02 +00:00
Martin Baulig
f0f9167682 Start a new page for each section. 1999-05-09 15:22:03 +00:00
Martin Baulig
6fbde2ea22 *** empty log message *** 1999-05-09 15:20:52 +00:00
Martin Baulig
2378f459de Added uptime and loadavg. 1999-05-09 15:19:55 +00:00
Martin Baulig
1b4ae67f51 Added memory and swap usage. 1999-05-09 15:08:52 +00:00
Martin Baulig
ec67c56cc7 *** empty log message *** 1999-05-09 13:55:43 +00:00
Martin Baulig
393c1dba75 Split the `libgtop.texi' into one file pro chapter, this is the "About
1999-05-09  Martin Baulig  <martin@home-of-linux.org>

	* about.texi: Split the `libgtop.texi' into one file pro chapter,
	this is the "About LibGTop".

	* reference.texi: The "LibGTop Reference Manual".
1999-05-09 13:54:03 +00:00
Martin Baulig
5b76314ef4 *** empty log message *** 1999-05-09 13:18:08 +00:00
Martin Baulig
0ca2053a27 One should ship the documentation of a package together with the tarball,
1999-05-09  Martin Baulig  <martin@home-of-linux.org>

	* doc: One should ship the documentation of a package together with
	the tarball, so I added this back.
1999-05-09 13:16:44 +00:00
Martin Baulig
c2c209d19a Initial version of the new LibGTop Manual.
1999-05-09  Martin Baulig  <martin@home-of-linux.org>

	* libgtop.texi: Initial version of the new LibGTop Manual.
1999-05-09 13:09:58 +00:00
Martin Baulig
de5137ff28 Define this here. Moved to limits.h.
1999-05-08  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/limits.h (GLIBTOP_MAX_GROUPS): Define this here.
	* include/glibtop/procuid.h (GLIBTOP_MAX_GROUPS): Moved to limits.h.

	* features.def: We can use constants from <glibtop/limits.h> here.
1999-05-08 19:53:31 +00:00
Drazen Kacar
ffb4b0fade Added s_open(), s_close() etc. with EINTR wrappers.
* safeio.c, safeio.h: Added s_open(), s_close() etc. with EINTR
        wrappers.

        * procdata.c, procmap.c, proclist.c: Use them.
1999-05-08 19:20:02 +00:00
Drazen Kacar
bfd03680cc Use bytes as units for memory consumption.
* procmem.c: Use bytes as units for memory consumption.
1999-05-08 17:39:54 +00:00
Drazen Kacar
82280b673e Deleted crap. 1999-05-08 04:49:04 +00:00
Drazen Kacar
27dbd28c5c Changed pfintf formats to "%lld" when printing u_int64_t. This is still
* mountlist.c: Changed pfintf formats to "%lld" when printing
        u_int64_t. This is still utterly unportable, but will
        hopefully work on all supported architectures. For now.
1999-05-08 04:40:44 +00:00
Drazen Kacar
4d55985151 Fixed pagesize.
* open.c: Fixed pagesize.
1999-05-08 02:10:00 +00:00
Drazen Kacar
2635e545bf Fixed nice value.
* procuid.c: Fixed nice value.
1999-05-08 01:53:41 +00:00
Martin Baulig
e8a3a40691 Moved them into the setgid server since they need to access kvm data.
1999-05-08  Martin Baulig  <martin@home-of-linux.org>

	* shm_limits.c, msg_limits.c, sem_limits.c: Moved them into the
	setgid server since they need to access kvm data.

	* open_suid.c, close_suid.c: New file. We do the initialization and cleanup
	for the setgid server here.

	* glibtop_suid.h: New file. We include this in the setgid files.

	* open.c: Moved kvm opening code into open_suid.c.
1999-05-07 23:24:08 +00:00
Drazen Kacar
3a7d7778a0 *** empty log message *** 1999-05-07 23:15:24 +00:00
Drazen Kacar
437c7585cc machine.pagesize is now number of bits we need for shifting, ie.
* glibtop_machine.h, open.c, mem.c, procmem.c: machine.pagesize
        is now number of bits we need for shifting, ie. 2^pagesize
        will give pagesize in Kb.
1999-05-07 23:13:46 +00:00
Martin Baulig
507766bff6 Use the setgid sys server for Solaris.
1999-05-08  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4: Use the setgid sys server for Solaris.
1999-05-07 23:09:11 +00:00
Martin Baulig
74d11991ab There's some problem with uname () - some systems like Solaris or Digital
1999-05-07  Martin Baulig  <martin@home-of-linux.org>

	* server.c (main): There's some problem with uname () - some systems
	like Solaris or Digital Unix return a nonnegative value on success,
	some others like Linux return 0. Since all known systems seem to return
	a negative value on failure, we simply check whether the return value is
	not negative here.
1999-05-07 22:58:21 +00:00
Drazen Kacar
217a1e92c6 Implemented size, vsize, resident and rss.
* procmem.c: Implemented size, vsize, resident and rss.
1999-05-07 20:38:13 +00:00
Martin Baulig
83bc7b831d Renamed this to `libgtop_timersub' and define it on all systems.
1999-05-07  Martin Baulig  <martin@home-of-linux.org>

	* timings.c (timersub): Renamed this to `libgtop_timersub' and define
	it on all systems.
1999-05-07 11:06:39 +00:00
Yukihiro Nakai
1071b2ee69 ja.po: Updated.
ja.po: Updated.
1999-05-07 11:01:39 +00:00
Martin Baulig
3753ac5ee6 Applied a patch from David Kaelbling:
some compilers (like the SGI IRIX 6.x native one) enfore the
  "casts are not lvalues" maxim.
1999-05-06 22:10:04 +00:00
Martin Baulig
6120c5e4a8 Use (1L << feature)' instead of (1 << feature)' to avoid problems
with integer overflows when we add more fields.
1999-05-06 21:35:36 +00:00
Drazen Kacar
b252a80b7e Fixed, valid for Solaris 2.6 & 7.
* siglist.c: Fixed, valid for Solaris 2.6 & 7.
1999-05-06 20:44:01 +00:00
Martin Baulig
d67182f411 Added pointer_size' which is the number of bits of a void *'.
1999-05-06  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/sysdeps.h (glibtop_sysdeps): Added `pointer_size'
	which is the number of bits of a `void *'.
1999-05-06 19:49:31 +00:00
Martin Baulig
fec8f23ad4 Merge alpha fix from the stable branch. 1999-05-06 13:22:34 +00:00
Drazen Kacar
ab7f1cc3be List of supplementary groups was not correct. Fixed.
* glibtop_private.h, procuid.c, procdata.c: List of supplementary
        groups was not correct. Fixed.
1999-05-06 01:15:44 +00:00
Drazen Kacar
3f65468299 Changed boot time to unsigned long long.
* glibtop_machine.h: Changed boot time to unsigned long long.

        * open.c: Added proper type checking for boot value. There's
        no point in saving a few nanoseconds in init function. And
        one day it will become 64-bit value.

        In glibtop_get_kstats(): Don't reread vminfo_snaptime when
        reinitializing kstats.
1999-05-03 23:02:58 +00:00
Martin Baulig
333d0c5709 *** empty log message *** 1999-05-03 18:44:52 +00:00
Martin Baulig
8c47939ad2 Set version number to 1.1.0. Also made a `LIBGTOP_STABLE_1_0' branch in
1999-05-03  Martin Baulig  <martin@home-of-linux.org>

	Set version number to 1.1.0. Also made a `LIBGTOP_STABLE_1_0'
	branch in CVS while development will go on here in the HEAD.
1999-05-03 18:43:37 +00:00
Martin Baulig
664d24f258 #include <glibtop_private.h>. 1999-05-03 12:20:21 +00:00
Martin Baulig
f8adb23062 We need to return NULL on error here. 1999-05-03 12:18:41 +00:00
Martin Baulig
a2a4b1d170 Fixed a broken sizeof (). 1999-05-03 12:17:56 +00:00
Drazen Kacar
aa6f26f9fb Fixed typoo.
* glibtop_private.h: Fixed typoo.

        * procmap.c (glibtop_get_proc_map_s): Implemented start, end,
        offset and perm for mapped segments. File name and inode
        should be accessible from bunyip kstat data. The only
        obstacle is that the data format is undocumented and
        possibly not the same accross releases.
1999-05-03 03:40:24 +00:00
Drazen Kacar
fd2ddf8b50 Forgot to commit the file. There's probably more of them arround. 1999-05-03 00:05:38 +00:00
Drazen Kacar
0408c86065 Read pstatus info from /proc
* glibtop_private.h, procdata.c (glibtop_get_proc_signal_s):
        Read pstatus info from /proc

        * procsignal.c (glibtop_get_proc_signal_s): Implemented
        set of pending and blocked signals. The rest should probably
        be read from /proc/<pid>/sigact, but I'm not sure it's
        worth implementing before thread API comes into place.

        * siglist.c: Added Solaris 7 signals. Someone will gettextize
        it eventually. Besides, signal list should become a pointer
        instead of being fixed field. We need some run time initializations.
        The code is written, but commented out.
1999-05-03 00:03:52 +00:00
Drazen Kacar
e1555fc335 Ups, forgot to put prototypes in.
* glibtop_private.h: Ups, forgot to put prototypes in.
1999-05-02 22:11:42 +00:00
Drazen Kacar
75141bdb65 Yet another kstat_chain_update check. Added machine.cpu_stat_kstat[x] =
* open.c (glibtop_get_kstats): Yet another kstat_chain_update
        check. Added machine.cpu_stat_kstat[x] = NULL when processor
        x is not configured.

        * procdata.c (glibtop_get_proc_credentials_s): Read prcred
        structure from /proc.

        * procstate.c (glibtop_get_proc_state_s): Added ruid, rgid,
        has_cpu, processor and last_processor.

        * procuid.c (glibtop_get_proc_uid_s): Added priority, nice,
        suid, sgid, ngroups and groups. The last four will be
        filled only if our process has the authority to read prcred
        structure of another process.

	It's a bit untested for now. :-)
1999-05-02 19:26:24 +00:00
Drazen Kacar
3951c8863f procdata.c: Use pread() instead of read(). 1999-05-02 05:45:21 +00:00
Drazen Kacar
bdc1579a9c added fields for page size, clock ticks and boot time. These are
* glibtop_machine.h: added fields for page size, clock ticks and
        boot time. These are constants. Also added three new kstats.

        * open.c (glibtop_get_kstats): Initialize kstats in *server.
        We need to call this at init time (obviously) and each time
        kstat_chain_update() says that kstat chain has changed. In this
        case all kstat pointers and data are invalid, so we need to
        reinitialize everything.

        (glibtop_open_s): Made it call glibtop_get_kstats(). Added
        initialization for run time constants in struct machine.

        * cpu.c (glibtop_get_cpu_s): Call kstat_chain_update().
        See if processor is on-line and set bits in xcpu_flags.
        Added frequency (bad name, should have been ticks).

        * swap.c (glibtop_get_swap_s): Call kstat_chain_update().
        I probably broke vminfo_snaptime consistency. Fix later.

        * uptime.c (glibtop_get_uptime_s): Implemented uptime and boot_time.
        Still looking for a sane way to get idletime.

        * mem.c (glibtop_get_mem_s): Implemented. Will use bunyip
        module if it's loaded. Or when it gets loaded. kstat_chain_update()
        is our friend. And with a friends like that...

        * loadavg.c (glibtop_get_loadavg_s): Solaris 2.6 code brought
        into sync with everything else.

        * msg_limits.c (glibtop_init_msg_limits_s): Implemented.

        * sem_limits.c (glibtop_get_sem_limits_s): Implemented.

        Solaris takes kernel modularity too seriously. We can't get
        IPC configuration data if the kernel module is not loaded and
        it won't be loaded until some process actually asks for a
        particular IPC resource. There's no way to tell our applications
        about this. Possible API additions?

        All three IPC functions should go into daemon, but I'm keeping
        them in the normal library because I can't build daemon yet. All
        praise 64 bits!
1999-05-02 03:18:32 +00:00
Drazen Kacar
8e1c6601af implemented.
* msg-limits.c: implemented.
1999-04-29 23:54:23 +00:00
Drazen Kacar
1c634bd736 implemented
* sem_limits.c: implemented
1999-04-29 22:57:36 +00:00
Drazen Kacar
2868191440 add field for kvm descriptor.
* glibtop_machine.h: add field for kvm descriptor.

        * open.c: add code for opening kernel name space.

        * shm_limits.c: implemented.

The real implementation will have this code in the daemon, since process
needs to be setgid sys to be able to read kernel symbols.
1999-04-29 20:42:17 +00:00
lukka
a567adcce5 small fi.po addition 1999-04-18 16:20:13 +00:00
lukka
5db1ee8fc4 Add fi.po 1999-04-18 15:58:19 +00:00
lukka
a6729d9454 Another typo fix 1999-04-18 14:39:41 +00:00
lukka
57f7039795 Typo fix 1999-04-18 14:31:43 +00:00
Martin Baulig
5c3775c6ee Set GLIBTOP_NCPU to 64, not 256. 1999-04-18 11:50:28 +00:00
Martin Baulig
1cec9b70a2 Thanks to Drazen Kacar for pointing out that not all processors must be
1999-04-18  Martin Baulig  <martin@home-of-linux.org>

	Thanks to Drazen Kacar for pointing out that not all processors must
	be running all the time under Solaris, so we need to have some flag
	to find out which processors are running.

	* (glibtop_cpu): Added `xcpu_flags' bitmask of running processors.
	* (glibtop_proc_time): Added `xcpu_flags'.
1999-04-18 11:47:58 +00:00
Martin Baulig
eca34c37d9 New file. (GLIBTOP_MAX_CPU): Define this here and increase it to 256.
1999-04-18  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/limits.h: New file.
	(GLIBTOP_MAX_CPU): Define this here and increase it to 256.
1999-04-18 11:36:42 +00:00
Kjartan Maraas
58acfc4042 Updated translation.
1999-04-13  Kjartan Maraas  <kmaraas@online.no>

		* no.po: Updated translation.
1999-04-13 12:23:46 +00:00
Martin Baulig
feab865203 Moved Timur's ChangeLog entry where it belongs. 1999-04-09 14:38:31 +00:00
Martin Baulig
754f09cdad Copied from the Linux sysdeps directory.
1999-04-09  Martin Baulig  <martin@home-of-linux.org>

	* sysinfo.c: Copied from the Linux sysdeps directory.
1999-04-09 14:36:04 +00:00
Timur Bakeyev
fac354623b Added initial port for BSD/OS (aka BSDI) 2.x and 3.x. 4.x should also(?)
Thu Apr  8 23:47:29 1999  Timur Bakeyev  <timur@gnu.org>

 	* cpu.c, mem.c, netload.c, procargs.c, procstate.c, proctime.c,
 	sem_limits.c, shm_limits.c, swap.c: Added initial port for BSD/OS
	(aka BSDI) 2.x and 3.x. 4.x should also(?) work.

	Still, this port require more close look and extended check.
1999-04-08 20:21:38 +00:00
Martin Baulig
5967e6c3e4 Copied from Linux sysdeps directory. 1999-04-05 12:55:56 +00:00
Martin Baulig
174f316a62 Added implementation for netload.c (glibtop_netload). 1999-04-05 12:53:00 +00:00
Martin Baulig
c9651a012e Changed function numbering so there's enough room for future additions;
set version number to 2.
1999-04-05 12:51:59 +00:00
Martin Baulig
3130d7db33 Added LIBGTOP_NETLOAD: Network statistics. 1999-04-05 12:49:04 +00:00
Martin Baulig
30af079f99 Added implementation for procmap.c (glibtop_proc_maps). 1999-04-03 22:55:42 +00:00
Martin Baulig
3ccae8efee Added LIBGTOP_PROC_MAPS: process memory maps. 1999-04-03 22:54:00 +00:00
Martin Baulig
5b946cb261 Added support for command line arguments (glibtop_proc_args). 1999-04-03 17:07:09 +00:00
Martin Baulig
885045ca55 Added LIBGTOP_PROC_ARGS for command line arguments. 1999-04-03 17:06:22 +00:00
Martin Baulig
01d728ac6b Reflect latest `proc_state.state' changes. 1999-04-01 10:33:13 +00:00
Martin Baulig
f9e670f464 Fixed typo. 1999-04-01 10:32:44 +00:00
Martin Baulig
868e1677e3 Added implementation for the newly added features. 1999-03-31 17:40:36 +00:00
Martin Baulig
84407de2aa *** empty log message *** 1999-03-31 17:38:53 +00:00
Martin Baulig
7011b04cb2 Let the constants for the `state' field start at 1. 1999-03-31 17:34:39 +00:00
Martin Baulig
ede4594dd9 Added some new features.
1999-03-30  Martin Baulig  <martin@home-of-linux.org>

	Added some new features.

	* (glibtop_uptime): Added `boot_time', boot time in seconds
	since the epoch.

	* (glibtop_proc_state): Changed `state' from char to unsigned.
	`uid' and `gid' are effective uid and gid; added comment.
	Added `ruid' and `rgid' for guaranteed-to-be-correct real uid/gid.
	For SMP systems: added `has_cpu', `processor' and `last_processor'.

	* (glibtop_proc_uid): Added suid, sgid, fsuid, fsgid, ngroups, groups.

	* (glibtop_proc_segment): Added start_data, end_data, start_brk,
	end_brk, start_mmap, arg_start, arg_end, env_start, env_end.

	* include/glibtop/procstate.h: Define some constants for the `state'
	field of glibtop_proc_state.

	* include/glibtop/prockernel.h: Define some constands for the
	`k_flags' field of glibtop_proc_kernel.
1999-03-31 16:53:05 +00:00
Drazen Kacar
3a7f02352a make it work with Solaris 2.6 and older. A part of it should be moved to
1999-03-31  Drazen Kacar  <dave@srce.hr>

        * loadavg.c: make it work with Solaris 2.6 and older. A part
        of it should be moved to open.c.
1999-03-31 07:48:37 +00:00
Martin Baulig
e2cb4ed031 Changed indentation (-bad -br -ce -i4):
tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4
1999-03-30 14:29:38 +00:00
Martin Baulig
24a1fe55bb Changed indentation:
tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4
1999-03-30 14:23:42 +00:00
Martin Baulig
66dddd9799 *** empty log message *** 1999-03-30 11:55:53 +00:00
Nam SungHyun
b3b2411cb7 updated 1999-03-30 10:42:06 +00:00
Martin Baulig
eb71d82ecc Added first timings for my new sysctl () based kernel interface. 1999-03-27 13:00:00 +00:00
Pablo Saratxaga
298fc043ff updated spanish language file 1999-03-27 02:43:08 +00:00
Kjartan Maraas
63f678210a updated
1999-03-27  Kjartan Maraas  <kmaraas@online.no>

		* no.po: updated
1999-03-26 23:56:47 +00:00
Martin Baulig
7a38246284 Don't include the private <glibtop_private.h>. 1999-03-26 17:50:30 +00:00
Martin Baulig
5390903a22 *** empty log message *** 1999-03-24 23:12:12 +00:00
Martin Baulig
4b9e977fdc *** empty log message *** 1999-03-24 21:38:15 +00:00
Martin Baulig
6a9a681559 *** empty log message *** 1999-03-24 20:42:49 +00:00
Martin Baulig
a6e919767c This statistics were made on a PPRO 200 running Linux 2.2.1
reading everything from /proc while the system was idle.
1999-03-24 16:31:43 +00:00
Martin Baulig
290e9ac767 Use getrusage () to get the timings and divide the timings by the
number of calls.
1999-03-24 15:44:28 +00:00
Martin Baulig
cd8ac36e9b Check for getloadavg () and swapctl () for Solaris.
1999-03-24  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Check for getloadavg () and swapctl () for
	Solaris.
1999-03-24 13:41:04 +00:00
Martin Baulig
3068969b51 *** empty log message *** 1999-03-24 00:58:25 +00:00
Martin Baulig
e947e72169 New example.
1999-03-24  Martin Baulig  <martin@home-of-linux.org>

	* timings.c: New example.
1999-03-24 00:58:00 +00:00
Martin Baulig
86a53dbfc9 Fixed a typo. 1999-03-24 00:56:33 +00:00
Martin Baulig
aa5c5c4553 Some more work here. 1999-03-23 18:42:32 +00:00
Martin Baulig
1f93237ee3 *** empty log message *** 1999-03-23 18:32:47 +00:00
Martin Baulig
3d248e9ad2 Added `wanted'. Applications can set the features they are interested in
1999-03-23  Martin Baulig  <martin@home-of-linux.org>

	* glibtop.h (glibtop): Added `wanted'. Applications can set the
	features they are interested in here. This way we don't waste CPU
	getting expensive data that aren't really needed.

	* LIBGTOP-VERSION: This breaks backward compatibility and also
	added new functions; set binary	age and interface age to 0.
1999-03-23 18:31:20 +00:00
Martin Baulig
ec9aedea0b *** empty log message *** 1999-03-22 14:34:34 +00:00
Martin Baulig
33021311b2 Some more work here. 1999-03-22 14:33:01 +00:00
Martin Baulig
2a3d9e080a Some more work here. 1999-03-21 23:22:59 +00:00
Martin Baulig
b528d0b1db *** empty log message *** 1999-03-21 19:09:31 +00:00
Martin Baulig
a429e9c3f9 Added implementation. 1999-03-21 19:08:59 +00:00
Martin Baulig
b90d2c1c90 Added back `sysdeps/kernel'. 1999-03-21 18:29:53 +00:00
Martin Baulig
27dc7ef79a Importing the `stub' sysdeps code. 1999-03-21 18:26:05 +00:00
Martin Baulig
76441b1d5f Importing `stub' sysdeps code here. 1999-03-21 18:23:02 +00:00
Martin Baulig
d2e3577784 Added a new sysctl () interface to the Linux Kernel.
1999-03-21  Martin Baulig  <martin@home-of-linux.org>

	Added a new sysctl () interface to the Linux Kernel.

	* kernel/sysctl: Imported.

	* libgtop-sysdeps.m4: If `--enable-hacker-mode' is given, check
	for my new sysctl () interface.
1999-03-21 18:20:56 +00:00
Martin Baulig
4a0344182f Removed a few debugging statements. 1999-03-21 18:11:18 +00:00
Martin Baulig
ddc496cdaa This is a kernel patch against 2.2.1 which you need to apply to
use the code here.
1999-03-21 18:05:22 +00:00
Martin Baulig
746981611b Initial import of my sysctl () module. 1999-03-21 17:57:51 +00:00
Martin Baulig
c1beefce3a Initial revision 1999-03-21 17:57:51 +00:00
Martin Baulig
1667cc8a8d Removed sysdeps/kernel/Makefile. 1999-03-20 17:05:18 +00:00
Martin Baulig
0aea46a643 Removed `kernel' from DIST_SUBDIRS. 1999-03-20 17:01:57 +00:00
Martin Baulig
820ab2210e Removed all traces of my old table () Linux kernel hack.
1999-03-20  Martin Baulig  <martin@home-of-linux.org>

	Removed all traces of my old table () Linux kernel hack.

	* kernel: Removed.
	* sysdeps/kernel: Removed.
	* libgtop-sysdeps.m4: Don't check for table (); it does not
	exist any longer.
1999-03-20 16:58:49 +00:00
Martin Baulig
f40e8a57b4 This is *untested* - please read "sysdeps/freebsd/ChangeLog" !
1999-03-19  Martin Baulig  <martin@home-of-linux.org>

	This is *untested* - please read "sysdeps/freebsd/ChangeLog" !

	* libgtop-sysdeps.m4: Use the `freebsd' sysdeps directory for
	BSDI as well if the `--enable-hacker-mode' parameter was given.
1999-03-19 10:51:56 +00:00
Martin Baulig
005357e821 Added basic support for BSDI. It compiles without problems on BSDI 2.1 and
1999-03-19  Martin Baulig  <martin@home-of-linux.org>

	Added basic support for BSDI. It compiles without problems on
	BSDI 2.1 and 3.1, but it is *untested* - I'm neither root on
	the machine nor have I access to /dev/kmem, so I don't know
	whether it will work.

	You need to give configure the `--enable-hacker-mode' parameter
	to use the code.

	If someone can verify whether it actually works, please let me
	know.
1999-03-19 10:47:44 +00:00
Martin Baulig
5fcfc95280 Added first kstat based implementation for Solaris 7.
1999-03-19  Martin Baulig  <martin@home-of-linux.org>

	Added first kstat based implementation for Solaris 7.

	* open.c (glibtop_open_s): Walk kstat list and save interesting
	kstats in the `server->machine'.

	* cpu.c: This can already provide `idle', `user' and `sys' with
	full SMP support.

	* swap.c: This can already provide `total', `used' and `free'.
1999-03-19 10:37:40 +00:00
Martin Baulig
dfc9e912b5 Added ChangeLog for the initial import. 1999-03-19 10:34:10 +00:00
Martin Baulig
a6385288aa *** empty log message *** 1999-03-19 10:20:33 +00:00
Martin Baulig
2f6457b3f7 Make the _glibtop_missing_feature () code actually working. 1999-03-18 13:15:13 +00:00
Martin Baulig
ba2f0f753b Set version number to 1.0.2 binary age 1, intergace age 1.
1999-03-18  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 1.0.2 binary age 1,
	intergace age 1.
1999-03-18 13:13:10 +00:00
Martin Baulig
38554dbcbe Don't use `sppp.pp_phase' if we don't HAVE_I4B_ACCT. This is an ugly hack
1999-03-18  Martin Baulig  <martin@home-of-linux.org>

	* ppp.c: Don't use `sppp.pp_phase' if we don't HAVE_I4B_ACCT.
	This is an ugly hack until someone tells me which versions have
	this field and which not.
1999-03-18 09:27:44 +00:00
Martin Baulig
fe98fde338 Avoid isspace('\0'). 1999-03-18 09:25:58 +00:00
Martin Baulig
c3ea69f26a Imported first version of my Solaris port.
1999-03-17  Martin Baulig  <martin@home-of-linux.org>

	Imported first version of my Solaris port.

	* configure.in: Check for `kstat_open' in `-lkstat'.

	* libgtop-sysdeps.m4: Recognize the `solaris' sysdeps directory
	when the `--enable-hacker-mode' parameter was given.
1999-03-17 18:39:13 +00:00
Martin Baulig
367e1f047c *** empty log message *** 1999-03-17 18:35:26 +00:00
Martin Baulig
7db1ed695c Fixed a bug that caused a core dump when the sysdeps code does not return
1999-03-17  Martin Baulig  <martin@home-of-linux.org>

	* first.c, second.c: Fixed a bug that caused a core dump when
	the sysdeps code does not return all data.
1999-03-17 18:33:25 +00:00
Martin Baulig
26b4615262 Importing initial version of my Solaris port. 1999-03-17 18:29:40 +00:00
Martin Baulig
c4ccf53aad Initial revision 1999-03-17 18:29:40 +00:00
Martin Baulig
8fe9163e6b Released the one and only final LibGTop 1.0.1. 1999-03-01 22:12:11 +00:00
Martin Baulig
293995a277 Released LibGTop 1.0.1.
1999-03-01  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 1.0.1.

	* LIBGTOP-VERSION: Set version number to 1.0.1 binary age 0,
	interface age 0.
1999-03-01 20:58:12 +00:00
Martin Baulig
991da49977 Last-minute removal for 1.0.1. 1999-03-01 20:57:36 +00:00
Martin Baulig
cbf3bc895e s/AC_CHECK_PROG/AC_CHECK_PROGS/ (in check for perl). 1999-03-01 20:41:26 +00:00
Pablo Saratxaga
75c105d65d updated spanish language file 1999-03-01 18:33:58 +00:00
Martin Baulig
e83cb0acf7 Added a missing #endif. 1999-03-01 15:33:30 +00:00
Martin Baulig
db4d801792 Move `-lgtop_common' last to make it work with static-only libs. Thanks to
1999-03-01  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (LIBGTOP_LIBS): Move `-lgtop_common' last to
	make it work with static-only libs. Thanks to Roderik Muit
	for pointing this out.
	(PERL): First check for `perl5', then for `perl'. Thanks again
	to Roderik Muit.
1999-03-01 13:27:10 +00:00
Martin Baulig
f17e45bcc3 Released LibGTop 1.0.0.
1999-02-24  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 1.0.0.
1999-03-01 13:01:34 +00:00
Martin Baulig
b912c83b8b Let's do another 1.0.0. 1999-02-28 11:55:40 +00:00
Martin Baulig
ec280b5bd0 Set version number to 1.0.0 binary age 0, interface age 0.
1999-02-24  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 1.0.0 binary age 0,
	interface age 0.

	* configure.in: Require GLIB >= 1.2.0.
1999-02-28 11:10:21 +00:00
Gregory McLean
3f39ec8d37 libtool is easy to confuse, we hand feed it on the Alpha that an Alpha is
an Alpha (from its point of view anyway)

-- Greg
1999-02-28 03:46:53 +00:00
Martin Baulig
8bbdeca6b5 Applied patch Stanislav Grozev for OpenBSD: only include <osreldate.h> for
1999-02-25  Martin Baulig  <martin@home-of-linux.org>

	* prockernel.c, proctime.c: Applied patch Stanislav Grozev for
	OpenBSD: only include <osreldate.h> for FreeBSD.
1999-02-25 20:44:31 +00:00
Martin Baulig
00960e6a04 Set version number to 1.0.0 binary age 0, interface age 0.
1999-02-24  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 1.0.0 binary age 0,
	interface age 0.

	* configure.in: Require GLIB >= 1.1.16.
1999-02-24 21:37:58 +00:00
Martin Baulig
8f4bb6c9c4 Applied another patch from Jeremy Lea to make it work with
1999-02-24  Martin Baulig  <martin@home-of-linux.org>

	* swap.c: Applied another patch from Jeremy Lea to
	make it work with FreeBSD-current.
1999-02-24 15:02:41 +00:00
Martin Baulig
f33814d409 Small fix to make it compile. 1999-02-24 14:32:00 +00:00
Martin Baulig
1a501c271a Released LibGTop 0.100.0.
1999-02-23  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 0.100.0.

	Make the copyright of LibGTop be the GNU General Public License.

	* LIBGTOP-VERSION: Set version number to 0.100.0 binary age 0,
	interface age 0.
1999-02-23 13:28:02 +00:00
Martin Baulig
5b43466d5f Really applied that patch. Don't know what happened to it before.
1999-02-21  Martin Baulig  <martin@home-of-linux.org>

	* procmap.c, procmem.c: Applied patch from Jeremy Lea.
1999-02-23 12:58:16 +00:00
Martin Baulig
83d8b9aedc Bumped the version number to 0.99.10 binary age 0 interface age 0.
This is a maintainer-release only. There will never be any "official"
tarball be made of this version.

A change like this deserves no other name than 0.100.0.

This is only to catch package building errors.
1999-02-23 11:49:15 +00:00
Martin Baulig
cf611f9157 Set the copyright of LibGTop to the GNU General Public License.
1999-02-22  Martin Baulig  <martin@home-of-linux.org>

	Set the copyright of LibGTop to the GNU General Public License.

	* copyright.txt: Set the year to 1998-99 and pretty-format it a
	little bit. Same in all C source and header files.
1999-02-23 11:47:35 +00:00
Martin Baulig
8ec7d76b35 Reverted this change and removed that file again.
1999-02-22  Martin Baulig  <martin@home-of-linux.org>

	* COPYING.LIB: Include a copy of the GNU Library General
	Public License here.
1999-02-23 10:56:49 +00:00
Martin Baulig
ce4f660965 Include a copy of the GNU Library General Public License here.
1999-02-22  Martin Baulig  <martin@home-of-linux.org>

	* COPYING.LIB: Include a copy of the GNU Library General
	Public License here.

	* copyright.txt: Set the year to 1998-99 and pretty-format it a
	little bit. Same in all C source and header files.
1999-02-22 16:19:36 +00:00
Martin Baulig
e46306d2f9 #include <sys/param.h>. 1999-02-21 19:56:03 +00:00
Martin Baulig
21b2aee946 Define `HAVE_GLIBTOP_MACHINE_H' if appropriate.
1999-02-21  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (LIBGTOP_*_INCS): Define `HAVE_GLIBTOP_MACHINE_H'
	if appropriate.
1999-02-21 19:51:06 +00:00
Martin Baulig
d379bb6acb Applied patch from the FreeBSD 2.2.8 ports collection.
1999-02-21  Martin Baulig  <martin@home-of-linux.org>

	* prockernel.c, proctime.c: Applied patch from the FreeBSD 2.2.8
	ports collection.
1999-02-21 14:23:09 +00:00
Martin Baulig
3ad9e06909 Applied patch from Jeremy Lea; this patch is also included in the
1999-02-21  Martin Baulig  <martin@home-of-linux.org>

	* procmap.c, procmem.c: Applied patch from Jeremy Lea; this
	patch is also included in the FreeBSD-current ports collection.
1999-02-21 14:11:07 +00:00
Martin Baulig
9ba9f4fa8f Applied patch from the NetBSD-current ports collection.
1999-02-21  Martin Baulig  <martin@home-of-linux.org>

	* procsignal.c: Applied patch from the NetBSD-current ports
	collection.
1999-02-21 14:08:14 +00:00
Martin Baulig
9142e721bb Don't include <linux/ip_fw.h> for libc5 systems since it is no longer
1999-02-20  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: Don't include <linux/ip_fw.h> for libc5 systems
	since it is no longer required and makes trouble on Slakware.
1999-02-20 16:20:30 +00:00
Martin Baulig
b7e1c60b40 Moved some things around in the ChangeLog. 1999-02-19 23:07:52 +00:00
Martin Baulig
72a3f5aaa1 Hardcoded system name. (LIBGTOP_COMPILE_RELEASE): Hardcoded system
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name.
	(LIBGTOP_COMPILE_RELEASE): Hardcoded system release.
	(LIBGTOP_COMPILE_MACHINE): Hardcoded machine type.

	* server.c (main): Abort if not running on the system the server
	was compiled on.
1999-02-19 23:02:09 +00:00
Martin Baulig
3c9b2e3d9f Reverted my last brain-dead commit.
Logical error:

we need to check whether the server runs on the system it was
compiled on and not whether the client uses a server that was
compiled on the clients system.
1999-02-19 22:34:52 +00:00
Martin Baulig
35995577ca For suid/sgid servers the operating system version must match the one the
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* lib/open.c, src/daemon/version.c: For suid/sgid servers the
	operating system version must match the one the server was
	compiled on.
1999-02-19 22:30:34 +00:00
Martin Baulig
eaf527d66a *** empty log message *** 1999-02-19 22:01:11 +00:00
Martin Baulig
a7bdfcb951 Don't include <glib.h>. Use int' not gint'.
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/error.h: Don't include <glib.h>.
	* sysdeps/common/error.c: Use `int' not `gint'.
1999-02-19 21:54:22 +00:00
Martin Baulig
9146d53ecc Small fix for 64bit systems. 1999-02-19 21:33:37 +00:00
Martin Baulig
38a4f74c1a Copied from stub_suid.
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* procmap.c, procargs.c, netload.c: Copied from stub_suid.

	* proclist.c, procsegment.c: Make them compile again.
1999-02-19 21:32:52 +00:00
Martin Baulig
0da389347e Added a few instructions on how to port LibGTop to Solaris.
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* misc/porting-libgtop.txt: Added a few instructions on how
	to port LibGTop to Solaris.
1999-02-19 20:16:43 +00:00
Martin Baulig
ba563cf615 Released LibGTop 0.99.9. 1999-02-19 19:03:13 +00:00
Martin Baulig
27fbdef425 Added which' and arg' arguments. 1999-02-19 19:00:51 +00:00
Martin Baulig
b27412def1 Make it compile again. 1999-02-19 18:58:49 +00:00
Martin Baulig
e5cb661a95 Make it work with Digital Unix native cc. 1999-02-19 12:26:41 +00:00
Martin Baulig
4def53aabb Sometimes @LIBSUPPORT@ references symbols from @INTLLIBS@ so we need
to put @INTLLIBS@ last.
1999-02-19 11:04:10 +00:00
Martin Baulig
ce45801873 Make it work with Digital Unix native cc. 1999-02-19 11:02:32 +00:00
Martin Baulig
a22d3fad36 *** empty log message *** 1999-02-19 10:12:50 +00:00
Martin Baulig
1272d38f72 Replace all __BEGIN_DELCS with LIBGTOP_BEGIN_DECLS and all __END_DECLS
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* Replace all __BEGIN_DELCS with LIBGTOP_BEGIN_DECLS and all
	__END_DECLS with LIBGTOP_END_DECLS; remove all __P macros and
	use real function prototypes.
1999-02-19 09:54:18 +00:00
Martin Baulig
2b96f77245 Set version number to 0.99.9 binary age 0, interface age 0.
1999-02-19  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 0.99.9 binary age 0,
	interface age 0.
1999-02-19 07:44:46 +00:00
Martin Baulig
c2fdf05f2b Include <glibtop/error.h>. 1999-02-19 07:32:39 +00:00
Martin Baulig
69fed8d42d Use glib-like function prototypes instead of "extern <function>
1999-02-18  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/*.h: Use glib-like function prototypes
	instead of "extern <function> __P((args))".
1999-02-18 20:39:37 +00:00
Martin Baulig
1da8264984 Replaced inline with static.
1999-02-18  Martin Baulig  <martin@home-of-linux.org>

	* sysdeps/common/error.h: Replaced inline with static.
1999-02-18 15:23:41 +00:00
Martin Baulig
2deb3c30c4 Replaced all awk scripts with perl scripts since it is more likely that
1999-02-18  Martin Baulig  <martin@home-of-linux.org>

	* */*.awk: Replaced all awk scripts with perl scripts since it is
	more likely that people have a working perl interpreter than GNU
	awk on their system.
1999-02-18 09:54:18 +00:00
Martin Baulig
00f0791ebd Define them as G_INLINE_FUNC in <glibtop/errno.h> if possible.
1999-02-18  Martin Baulig  <martin@home-of-linux.org>

	* sysdeps/common/error.c (glibtop_error_r, glibtop_warn_r): Define
	them as G_INLINE_FUNC in <glibtop/errno.h> if possible.
	(glibtop_error_io_r, glibtop_warn_io_r): Likewise.
	(glibtop_error_vr, glibtop_warn_vr): New functions taking a va_list.
	(glibtop_error_io_vr, glibtop_warn_io_vr): New functions taking an
	errno an a va_list.
1999-02-18 08:57:03 +00:00
Martin Baulig
ad7aca6105 Released LibGTop 0.99.8. 1999-02-17 10:33:43 +00:00
Martin Baulig
1ea58b48ff Initialize INCLUDES to `@INCLUDES@' to make it clear that it is set in
1999-02-16  Martin Baulig  <martin@home-of-linux.org>

	* examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am,
	  sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am,
	  sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am,
	  sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am,
	  sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am,
	  sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am:
	Initialize INCLUDES to `@INCLUDES@' to make it clear that it is
	set in configure.in. It is ok to add things there, but you must
	not remove the `@INCLUDES@'.
1999-02-16 15:13:26 +00:00
Martin Baulig
dd17160a5f Not much here; removed the old release notes from the bottom, removed all
traces of libgtop-apps and replaced 0.25 to 1.0.
1999-02-16 14:47:14 +00:00
Martin Baulig
1086496f93 Release notes for LibGTop 1.0. 1999-02-16 14:41:58 +00:00
Martin Baulig
896729108c Fixed Jeff's ChangeLog to make it match the correct situation. 1999-02-15 23:17:49 +00:00
Martin Baulig
f5397c79b0 *** empty log message *** 1999-02-15 23:09:19 +00:00
Martin Baulig
4fbfde4d1c Fix a really bad thing from Jeff Garzik; don't override INCLUDES in
any Makefile.am, but it configure.in.
1999-02-15 23:04:07 +00:00
Jeff Garzik
cd7cd23403 Removed hardcoded gcc arguments. Converted remaining CFLAGS settings to
1999-02-15  Jeff Garzik  <jgarzik@pobox.com>

        * examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am,
          sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am,
          sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am,
          sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am,
          sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am,
          sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am:
        Removed hardcoded gcc arguments.
        Converted remaining CFLAGS settings to use correct INCLUDES.

        * include/glibtop/error.h:
        Added FIXME comment about varargs macros breaking Sun cc
        compilation.
1999-02-15 21:23:07 +00:00
Martin Baulig
48e5a13495 Really forgot them ... 1999-02-12 10:56:01 +00:00
Martin Baulig
137bbe308c Thanks to Frederic Devernay for pointing out that we need to define
1999-02-12  Martin Baulig  <martin@home-of-linux.org>

	Thanks to Frederic Devernay for pointing out that we need to define
	__BEGIN_DECLS and __END_DECLS when not using GNOME.

	* configure.in: Define `WITHOUT_GNOME' if appropriate.

	* include/glibtop/global.h: Define __BEGIN_DECLS and __END_DECLS
	when WITHOUT_GNOME not when _IN_LIBGTOP.
1999-02-12 09:41:41 +00:00
Martin Baulig
eca7c245f8 Applied patch from Frederic Devernay; __BEGIN_DECLS and __END_DECLS are
1999-02-12  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/global.h: Applied patch from Frederic Devernay;
	__BEGIN_DECLS and __END_DECLS are only defined inside _IN_LIBGTOP.
1999-02-12 08:36:13 +00:00
Martin Baulig
4d220ddb26 Renamed them; looks better this way ... 1999-02-11 22:17:06 +00:00
Martin Baulig
3f6800469b 'make distcheck' tends to modify these. 1999-02-11 19:13:29 +00:00
Martin Baulig
af4dadde0b Set version number to 0.99.8 binary age 8 interface age 8. 1999-02-11 19:08:32 +00:00
Martin Baulig
8773604ef1 Declare this as `extern' if necessary.
1999-02-10  Martin Baulig  <martin@home-of-linux.org>

	* gnuserv.c (program_invocation_*_name): Declare this as `extern'
	if necessary.
1999-02-11 18:40:36 +00:00
Martin Baulig
411a1c8e84 Check whether we need to declare this; some libc5 systems define that
1999-02-10  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (program_invocation_name): Check whether we need
 	to declare this; some libc5 systems define that symbol but do
	not declare it in any header file.
1999-02-11 18:40:14 +00:00
Martin Baulig
5b38a14a44 Include <errno.h> 1999-02-11 18:08:38 +00:00
Martin Baulig
208c7a0ce0 Ignore them for the moment.
I'm preparing LibGTop and its documentation for the upcoming 1.0 release
at the moment, but this release will be made together with GNOME 1.0.

Martin
1999-02-11 10:07:46 +00:00
Martin Baulig
96542d050e Nuked the old README and moved README.LATEST to README. 1999-02-11 10:02:20 +00:00
Martin Baulig
7790965d45 Renamed NEWS to NEWS.old and created an empty NEWS. 1999-02-11 09:58:56 +00:00
Martin Baulig
505c175cb6 The removed file was a left-over from the first pre-alpha 0.01 release
I ever did.
1999-02-11 09:56:04 +00:00
Pablo Saratxaga
7af22c51b9 updated spanish language file 1999-02-11 01:08:35 +00:00
Martin Baulig
1cadb2c3be Make it work with the generated libgtop.spec. 1999-02-10 15:24:32 +00:00
Martin Baulig
6e278d98f1 *** empty log message *** 1999-02-10 15:00:20 +00:00
Martin Baulig
17a1b6b1cb Replaced libgtop.spec with with libgtop.spec.in, so libgtop.spec is now a
1999-02-10  Martin Baulig  <martin@home-of-linux.org>

	* libgtop.spec.in, libgtop.spec: Replaced libgtop.spec with
	with libgtop.spec.in, so libgtop.spec is now a generated file.
1999-02-10 14:59:16 +00:00
Martin Baulig
8a25330615 Enclose some of the stuff in this file in `#ifdef _IN_LIBGTOP'.
1999-02-05  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/global.h: Enclose some of the stuff in this
	file in `#ifdef _IN_LIBGTOP'.
1999-02-05 11:12:57 +00:00
Martin Baulig
ce52ba2dbe Use _' instead of gettext'.
1999-02-04  Martin Baulig  <martin@home-of-linux.org>

	* names/guile-names.awk: Use `_' instead of `gettext'.
1999-02-04 19:24:40 +00:00
Martin Baulig
bfe951b32a Use dgettext (), not gettext ().
1999-02-04  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/global.h (_): Use dgettext (), not gettext ().
1999-02-04 19:23:30 +00:00
Nam SungHyun
7bdcc494c3 updated some 1999-02-04 15:39:03 +00:00
Kjartan Maraas
7922e3bcc7 Updated translation
1999-01-27  Kjartan Maraas  <kmaraas@fib.hl.no>

		* Updated translation
1999-01-27 22:27:57 +00:00
Martin Baulig
f2c8347f34 New variable.
1999-01-23  Martin Baulig  <martin@home-of-linux.org>

	* libgtopConf.sh.in (LIBGTOP_DATADIR): New variable.
1999-01-23 18:23:44 +00:00
Martin Baulig
413283849c Set version number to 0.99.3, binary age 3, interface age 3. 1999-01-22 22:54:58 +00:00
Martin Baulig
6dd6173874 Updated german translation. 1999-01-22 22:53:04 +00:00
Martin Baulig
16da233b6d `glibtop_names_* []' should be the plain name without array dimensions. 1999-01-22 15:36:35 +00:00
Martin Baulig
3f0e166e3f Use a (TYPE . DIMENSION)' pair for array types in glibtop-types-*'.
1999-01-22  Martin Baulig  <martin@home-of-linux.org>

	* names/guile-names.awk: Use a `(TYPE . DIMENSION)' pair for
	array types in `glibtop-types-*'.
1999-01-22 13:50:20 +00:00
Martin Baulig
8262f295b7 Reverted last change, should have installed newer autoconf first ... 1999-01-20 23:24:31 +00:00
Martin Baulig
73a334727e Added WITH_SYMBOL_UNDERSCORE. 1999-01-20 20:50:55 +00:00
Martin Baulig
059992ef36 Reflect new sources directory on ftp.gnome.org. 1999-01-16 19:50:18 +00:00
Martin Baulig
df20c8534b Don't declare strstr () here, this should be done in gnomesupport if it
is really required on some system.
1999-01-10 13:03:18 +00:00
Martin Baulig
8ba42b25e0 Use `server->os_version_code' instead of GLIBTOP_LINUX_VERSION_CODE.
1999-01-06  Martin Baulig  <martin@home-of-linux.org>

	* netload.c (glibtop_get_netload_s): Use `server->os_version_code'
	instead of GLIBTOP_LINUX_VERSION_CODE.
1999-01-06 19:59:04 +00:00
Martin Baulig
3b270123eb Always enable SMP support for Linux.
1999-01-06  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4: Always enable SMP support for Linux.
1999-01-06 19:55:04 +00:00
Martin Baulig
a66b6cc86d Set indent level to 4. 1999-01-06 19:30:55 +00:00
Martin Baulig
e491343151 Unconditionally enable SMP support for linux.
1999-01-06  Martin Baulig  <martin@home-of-linux.org>

	Unconditionally enable SMP support for linux.

	* open.c (_glibtop_open_s): Always determine the number of CPUs
	we have here, not only when SMP support was enabled.

	* cpu.c, proctime.c: Use `server->ncpu' to determine whether to
 	enable SMP support.
1999-01-06 19:26:45 +00:00
Martin Baulig
688e65fbec Released LibGTop 0.99.2.
1999-01-03  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 0.99.2.
1999-01-05 12:23:03 +00:00
Martin Baulig
c1c629eb37 LibGTop will now require GLIB >= 1.1.12.
1999-01-05  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: LibGTop will now require GLIB >= 1.1.12.
1999-01-05 12:21:54 +00:00
Martin Baulig
5566a5cde2 Updated TODO. 1999-01-05 12:11:53 +00:00
Martin Baulig
364130c6e1 Always build SMP support; binary packages should contain all possible
1999-01-05  Martin Baulig  <martin@home-of-linux.org>

	* libgtop.spec: Always build SMP support; binary packages should
	contain all possible features.
1999-01-05 12:07:43 +00:00
Martin Baulig
394d4dc226 LibGTop will now require GLIB >= 1.1.11.
1999-01-05  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: LibGTop will now require GLIB >= 1.1.11.
1999-01-05 11:10:08 +00:00
Martin Baulig
ce80f111df This should now be working for 2.2.0-pre kernels. 1999-01-05 11:08:12 +00:00
Martin Baulig
abdeeda9c0 Make it abort if the `dc' utility is not installed.
1999-01-05  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Make it abort if the `dc' utility is not installed.
1999-01-05 10:52:56 +00:00
Martin Baulig
e0d4139bf2 Released LibGTop 0.99.1.
1999-01-03  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 0.99.1.
1999-01-03 19:18:56 +00:00
Martin Baulig
17962b4548 Minor `make distcheck' fixes. 1999-01-03 19:17:39 +00:00
Martin Baulig
2f12b5aec2 Seems I forgot to check this in some time ago ... 1999-01-02 21:44:18 +00:00
Martin Baulig
be97f1b90a When using glibc, don't include <netinet/ip_fw.h> any longer but all
1998-12-28  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: When using glibc, don't include <netinet/ip_fw.h>
 	any longer but all headers that were included there; we only
 	needed this file to get those headers.
1998-12-28 22:37:37 +00:00
Kjartan Maraas
a9928eb8a8 Updated translation
1998-12-27  Kjartan Maraas  <kmaraas@fib.hl.no>

		* Updated translation
1998-12-27 12:25:40 +00:00
Martin Baulig
3dfd759826 Define `HAVE_LIBGTOP_SMP' if SMP support was enabled.
1998-12-25  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (LIBGTOP_INCS): Define `HAVE_LIBGTOP_SMP' if SMP
	support was enabled.
1998-12-25 19:07:08 +00:00
Martin Baulig
48191c7111 Small fix; look for the colon separating key and value. 1998-12-24 21:54:26 +00:00
Yukihiro Nakai
5a0b925037 Add Japanese translation from Eiichiro ITANI <emu@ceres.dti.ne.jp>
Add Japanese translation from Eiichiro ITANI <emu@ceres.dti.ne.jp>
1998-12-22 06:05:34 +00:00
Martin Baulig
58e1e76a06 Applied patch from Edward Jason Riedy to use '#' as separator in sed
1998-12-18  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Applied patch from Edward Jason Riedy to use '#'
	as separator in sed commands.
1998-12-18 12:16:40 +00:00
Kjartan Maraas
4bc0213ca9 Updated translation
1998-12-17  Kjartan Maraas  <kmaraas@fib.hl.no>

		* Updated translation
1998-12-17 19:21:23 +00:00
Martin Baulig
266d9e013f Don't include <gnome-argp.h>. (program_invocation_name,
1998-12-17  Martin Baulig  <baulig@merkur.uni-trier.de>

	* gnuserv.c: Don't include <gnome-argp.h>.
	(program_invocation_name, program_invocation_short_name): Define
	this here.
1998-12-17 15:01:02 +00:00
Martin Baulig
3b1626912d Reverted Elliot's change here, we need to #include <gnome-argp.h> to get
the declaration for program_invocation name on libc5 systems.
1998-12-16 18:34:54 +00:00
Martin Baulig
c0eb843fc4 s/AM_GNU_GETTEXT/AM_GNOME_GETTEXT/ - the final fix for libc5 systems. 1998-12-15 23:13:56 +00:00
Elliot Lee
b89011bce9 no gnome-argp.h
no gnome-argp.h
1998-12-15 22:18:12 +00:00
Martin Baulig
acd110f1cc Just set the version number to 0.99.0 to keep it in sync with the rest
of GNOME.

1998-12-15  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 0.99.0 which is a feature-freezed version
	for GNOME 1.0.
1998-12-15 19:03:50 +00:00
Martin Baulig
b4d0ee6df2 Released LibGTop 0.30.0 which is a feature-freezed version for GNOME 1.0.
1998-12-15  Martin Baulig  <martin@home-of-linux.org>

	Released LibGTop 0.30.0 which is a feature-freezed version
	for GNOME 1.0.
1998-12-15 13:13:41 +00:00
Manish Vachharajani
6d62e9c466 Remove obsolete files from POTFILES.in 1998-12-15 04:03:33 +00:00
Pablo Saratxaga
6ea9c2e2cb updated spanish language file 1998-12-13 21:43:29 +00:00
Frederic Devernay
d884adbf7f Some don't have LOG_PERROR, quick fix 1998-12-11 08:24:44 +00:00
Martin Baulig
f2074892ae Oops, better #include <gnome-argp.h> here ... 1998-12-10 12:31:18 +00:00
Martin Baulig
e890aaaf28 #include <gnomesupport-fake.h> 1998-12-10 12:17:54 +00:00
Martin Baulig
b1f8913794 Larger changes to the daemon:
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	Larger changes to the daemon:

	- Dropped all the unix domain socket stuff - we don't need it for
	connections on the local host, here we behave just like any normal
	application.
	- Added poptimization: use the --help parameter to get usage info
	- Made it a real daemon, fork into background and write to syslog.
	- It's now possible to invoke the daemon from inetd, you'll get
	GNU_SECURE authentication in this case.
	- Don't make this executable suid/sgid - if invoked as root it
	sets uid/gid to SERVER_UID/SERVER_GID as defined in server_config.h
	- Added missing features, so you can now really use this thing.
1998-12-09 21:28:45 +00:00
Martin Baulig
3daeda7307 We need to define LIBSUPPORT and SUPPORTINCS under all circumstances as it
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: We need to define LIBSUPPORT and SUPPORTINCS under
	all circumstances as it is in gnome-libs.
1998-12-09 21:19:44 +00:00
Martin Baulig
9e41d36684 Small fix. 1998-12-09 17:48:35 +00:00
Martin Baulig
e140f93bf5 Added implementation for proc_args and netload. 1998-12-09 15:43:29 +00:00
Martin Baulig
3393adefa7 Added the missing `proc_args' field. 1998-12-09 14:52:05 +00:00
Martin Baulig
5599022989 Added correct (glibtop-get-proc-args) implementation. 1998-12-09 12:06:16 +00:00
Martin Baulig
1520ee7083 Make the return value a char *' instead of a const char *'.
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/procargs.h (glibtop_get_proc_args): Make the
	return value a `char *' instead of a `const char *'.
1998-12-09 11:38:49 +00:00
Martin Baulig
ee9812e9af For arrays, make a gh_list out of it and add this list to the returned
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* guile.awk: For arrays, make a gh_list out of it and add this list
	to the returned list instead of adding all array fields there.
1998-12-09 09:41:32 +00:00
Martin Baulig
2f20f2b7ff Updated. 1998-12-09 00:01:06 +00:00
Martin Baulig
dd4ec711a9 Set version number to 0.29.1.
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 0.29.1.
1998-12-08 23:55:13 +00:00
Martin Baulig
c9f66159f0 `make distcheck' should work now ... 1998-12-08 23:53:44 +00:00
Martin Baulig
34133fe238 *** empty log message *** 1998-12-08 23:40:40 +00:00
Martin Baulig
d6e0aa2942 Moved here from the macros directory, formerly known as
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4: Moved here from the macros directory,
	formerly known as `macros/gnome-libgtop-sysdeps.m4'.
	(--enable-hacker-mode): New command line parameter to configure,
	enables building of unstable sysdeps directories.
	(LIBGTOP_HACKER_TESTS): New macro to check for unsafe things when
	hacker mode was enabled.
1998-12-08 23:40:11 +00:00
Martin Baulig
0bda0d4fc9 Let aclocal.m4 depend on libgtop-sysdeps.m4 in maintainer mode. 1998-12-08 23:38:19 +00:00
Martin Baulig
29145f7c11 Added `.' to AM_ACLOCAL_INCLUDE. 1998-12-08 23:32:54 +00:00
Martin Baulig
3da3f1b03f Moved doc' and guile' subdirectories into the libgtop-docu module. 1998-12-08 23:23:52 +00:00
Martin Baulig
cd7ca97fc5 Moved here from the macros directory, formerly known as
1998-12-09  Martin Baulig  <martin@home-of-linux.org>

	* libgtop-sysdeps.m4: Moved here from the macros directory,
	formerly known as `macros/gnome-libgtop-sysdeps.m4'.
1998-12-08 23:01:44 +00:00
Martin Baulig
e3dd231a3d Don't need to have a copy of libproc from procps laying around here. 1998-12-08 22:36:44 +00:00
Martin Baulig
d396bb6258 This directory was dropped a long time ago ... 1998-12-08 22:35:05 +00:00
Martin Baulig
6ccd22ae04 New guile function.
1998-12-08  Martin Baulig  <martin@home-of-linux.org>

	* guile.awk (glibtop-get-sysdeps): New guile function.
1998-12-08 21:08:23 +00:00
Martin Baulig
f720f21e07 Make a gh_list for each map entry and append all of them to the returned
1998-12-08  Martin Baulig  <martin@home-of-linux.org>

	* guile.awk (glibtop_get_proc_map): Make a gh_list for each map
	entry and append all of them to the returned list.
	(glibtop_get_mountlist): Likewise.
1998-12-08 20:50:02 +00:00
Martin Baulig
da51ae35c0 updated TODO. 1998-12-08 19:12:47 +00:00
Martin Baulig
25a6834aae Make a gh_list for each map entry and append all of them to the returned
1998-12-08  Martin Baulig  <martin@home-of-linux.org>

	* guile.awk (glibtop_get_proc_map): Make a gh_list for each map
	entry and append all of them to the returned list.
1998-12-08 19:11:36 +00:00
Martin Baulig
2795790ab6 Sync. 1998-12-08 18:52:00 +00:00
Jeff Garzik
4ca23b4e06 GNOME-standard autogen.sh scripts automatically run 'automake -a'. -a
installs any necessary files that are required in a GNU-standard
install, such as COPYING, INSTALL, mkinstalldirs, etc.

So begone, automake-installed files.
1998-12-07 06:05:09 +00:00
Martin Baulig
ceabdfd2dc This works now for FreeBSD and NetBSD. 1998-12-06 17:54:17 +00:00
Martin Baulig
20f3c3eb60 This works on all supported systems (FreeBSD, NetBSD, OpenBSD) now. 1998-12-06 17:02:45 +00:00
Martin Baulig
151c5ee80e Make it abort if GNOME cannot be found and the --without-gnome parameter
1998-12-06  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Make it abort if GNOME cannot be found and
	the --without-gnome parameter was not given.
1998-12-06 13:38:28 +00:00
Martin Baulig
213fb37f26 Oops, misspelled C preprocessor directive ... (it's #elif not #elsif). 1998-12-06 13:02:02 +00:00
Martin Baulig
fd77db5f8d Updated TODO. 1998-12-06 11:10:21 +00:00
Martin Baulig
50e4bdfc93 Make it work with OpenBSD 2.4.
1998-12-06  Martin Baulig  <martin@home-of-linux.org>

	* Make it work with OpenBSD 2.4.

As with NetBSD: it compiles fine and the executables do not dump core -
but needs a closer look whether the returned data are all valid.
1998-12-06 11:08:12 +00:00
Martin Baulig
b7e5a6da2d *** empty log message *** 1998-12-05 19:56:08 +00:00
Martin Baulig
67a344b9d4 Make it work with NetBSD 1.3.2.
1998-12-05  Martin Baulig  <martin@home-of-linux.org>

	* Make it work with NetBSD 1.3.2.

Well, it compiles without problems but not all features are currently
working; need to look a little bit closer at it.

Ok for now, think I'll install OpenBSD and test it there ...

Martin
1998-12-05 18:52:09 +00:00
Martin Baulig
d414a22ee3 *** empty log message *** 1998-12-03 16:17:56 +00:00
Martin Baulig
0b315c266b Pipe the expression through `dc' so we get a real number.
1998-12-03  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Pipe the expression
	through `dc' so we get a real number.
1998-12-03 16:14:48 +00:00
Martin Baulig
c90462bc26 No longer include <linux/version.h>, but use GLIBTOP_LINUX_VERSION_CODE
1998-12-03  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: No longer include <linux/version.h>, but use
	GLIBTOP_LINUX_VERSION_CODE which is set by configure instead.
	Define _GLIBTOP_IP_FW_ACCTIN and _GLIBTOP_IP_FW_ACCTOUT here
	and use them instead of IP_FW_F_ACCTIN and IP_FW_F_ACCTOUT.
1998-12-03 16:12:43 +00:00
Martin Baulig
6760a41ad9 *** empty log message *** 1998-12-03 14:43:49 +00:00
Martin Baulig
83d51392dc Removed the 'sed .. POTFILES ...'. 1998-12-03 14:34:34 +00:00
Martin Baulig
6b736f1f87 I really should include <linux/version.h> here ... 1998-11-30 20:52:54 +00:00
Martin Baulig
5fed8969c6 Use correct header files both for libc5 and glibc. With Linux >= 2.1.114
1998-11-30  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: Use correct header files both for libc5 and glibc.
	With Linux >= 2.1.114 we no longer use IP accounting since it
	already has byte counts in /proc/net/dev.
1998-11-30 20:30:32 +00:00
Martin Baulig
079ddfae31 Set version number to 0.29.0.
1998-11-27  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 0.29.0.

	* TODO: Add things that need to be done before Dec 15.

	This is basically a feature freeze for the C language part
	of LibGTop except for things that are marked with (***) in
	the TODO.
1998-11-27 12:56:12 +00:00
Martin Baulig
a701fc7aa6 Minor /proc/net/dev parsing updates; has nothing to do with latest
compilation problems.
1998-11-27 10:34:01 +00:00
Martin Baulig
cd7976f3cd #include <net/if.h> #include <netinet/ip_fw.h>
#include <net/if.h>
#include <netinet/ip_fw.h>
1998-11-26 22:37:04 +00:00
Pablo Saratxaga
bdbc251228 Strings that have numbers are translated differently for
DO, GT, HN, MX, PA, PE and SV than in other spanish speaking countries.
1998-11-25 22:49:24 +00:00
Martin Baulig
12b9e30f1c *** empty log message *** 1998-11-22 19:30:45 +00:00
Martin Baulig
ef36d36060 Print address first and then the subnet. 1998-11-22 19:29:17 +00:00
Martin Baulig
11c7fad8d4 Call inet_ntoa () to get address and subnet in quatted dot notation (like
1998-11-22  Martin Baulig  <baulig@taurus.uni-trier.de>

	* netload.c: Call inet_ntoa () to get address and subnet
	in quatted dot notation (like 136.199.14.201) and not just
	as a number (like 0xc90ec788).
1998-11-22 19:26:43 +00:00
Martin Baulig
9c0ec8c69f Added implementation for this function.
1998-11-22  Martin Baulig  <baulig@merkur.uni-trier.de>

	* netload.c (glibtop_get_netload_s): Added implementation
	for this function.

	The code here is smart enough to use /proc/net/ip_acct if
 	IP accounting is enabled in the kernel and activated on the
 	requested device and /proc/net/dev if not.

	To get separate statistics for received and transmitted
	packets you need to use two accounting rules:

	ipfwadm -A in -a -P all -W eth0
	ipfwadm -A out -a -P all -W eth0

	But before you activate IP accounting, please have a look
	at /proc/net/dev - if if already contains byte counters,
	then don't use IP accounting.
1998-11-22 19:24:14 +00:00
Martin Baulig
4ac6972be6 Applied a patch from Kenneth Stailey to make it work on OpenBSD.
1998-11-20  Martin Baulig  <baulig@merkur.uni-trier.de>

	* sysdeps/common/mountlist.c: Applied a patch from Kenneth Stailey to
	make it work on OpenBSD.
1998-11-20 14:35:29 +00:00
Martin Baulig
7a0a779311 Great !!! It's working on my FreeBSD 3.0 machine now ... !!! 1998-11-17 23:15:12 +00:00
Martin Baulig
92f1bf261c We need to set argv[0] in call to execl () to avoid a core dump in _init
1998-11-18  Martin Baulig  <martin@home-of-linux.org>

	* lib/open.c (glibtop_open_l): We need to set argv[0] in call
	to execl () to avoid a core dump in _init () on FreeBSD 3.0.
1998-11-17 23:12:35 +00:00
Pablo Saratxaga
6abcbd5458 updated es.po file 1998-11-17 22:37:22 +00:00
Martin Baulig
a637c8b406 Don't define this any longer, we now use the port the daemon is listening
1998-11-11  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/gnuserv.h (MCOOKIE_SCREEN): Don't define this
	any longer, we now use the port the daemon is listening on instead
	of a fixed screen.
1998-11-11 20:56:09 +00:00
Martin Baulig
d59234afc2 Fix a compiler warning. 1998-11-11 20:53:38 +00:00
Martin Baulig
8e67a4cad1 Added $X_CFLAGS to the INCLUDES. 1998-11-11 20:29:47 +00:00
Martin Baulig
0afb34b0c1 Fixed Xauth check; don't rely upon a $window_system variable to be set
and use correct X_CFLAGS in the check for the X11/Xauth.h header file.
1998-11-11 20:25:54 +00:00
Martin Baulig
f24a4d9d22 Set `server->features' directly rather than calling
1998-11-11  Martin Baulig  <martin@home-of-linux.org>

	* gnuserv.c (main): Set `server->features' directly rather than
	calling glibtop_set_parameter_l () since this function no longer
	allows to modify the features.

	* gnuserv.c, main.c: Use LIBGTOP_ENABLE_DEBUG rather than DEBUG.
1998-11-11 19:59:38 +00:00
Martin Baulig
44b03ba60b Define LIBGTOP_ENABLE_DEBUG if this parameter is given.
1998-11-11  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG
	if this parameter is given.
	(--enable-fatal-warnings): New parameter to make all warnings
	fatal; define `LIBGTOP_FATAL_WARNINGS' if given.

	* sysdeps/common/error.c (glibtop_error_r): Use abort () instead
	of exit () if LIBGTOP_ENABLE_DEBUG.
	(glibtop_error_io_r): Likewise.
	(glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS.
	(glibtop_warn_io_r): Likewise.

	[NOTE: To get a core dump of the libgtop_server, you need to
	remove all suid/sgid bits and invoke it as a priviledged user.]
1998-11-11 16:02:01 +00:00
Martin Baulig
d46c6227fb It does not work to get information about the swapper task on FreeBSD
1998-11-11  Martin Baulig  <martin@home-of-linux.org>

	* *.c: It does not work to get information about the swapper task
	on FreeBSD 2.2.6, so we simple return if pid == 0.
1998-11-11 15:58:22 +00:00
Pablo Saratxaga
fffabe63b7 added spanish language file 1998-11-08 22:44:23 +00:00
Raja R Harinath
ecaa9d9a35 Don't build if not BUILD_GNOME_SUPPORT.
* Makefile.am (support): Don't build if not BUILD_GNOME_SUPPORT.
1998-11-08 21:45:33 +00:00
Kjartan Maraas
45b63f5131 Update translation and quiet cvs.
1998-11-07  Kjartan Maraas  <kmaraas@fib.hl.no>

		* Update translation and quiet cvs.
1998-11-07 11:13:40 +00:00
Martin Baulig
ee2d10729c Just some short TODO file for me so I know what I have to do before
making the next release.
1998-11-02 21:30:24 +00:00
Martin Baulig
b3262820c5 Added `GLIBTOP_PARAM_REQUIRED'.
1998-11-02  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/parameter.h: Added `GLIBTOP_PARAM_REQUIRED'.

	* lib/parameter.c (glibtop_set_parameter_l): It's no longer
	allowed to set GLIBTOP_PARAM_FEATURES.
	(glibtop_get_parameter_l): You can use `GLIBTOP_PARAM_REQUIRED'
	to read server->required and ...
	(glibtop_set_parameter_l): ... set it here.
1998-11-02 21:19:56 +00:00
Martin Baulig
4371bc81c9 `sysdeps.flags' should be a mask telling which fields are valid,
so we set it to `(sysdeps.features | (1 << GLIBTOP_SYSDEPS_FEATURES))'.
1998-11-02 21:09:11 +00:00
Martin Baulig
a6f7f0259e *** empty log message *** 1998-11-02 20:51:51 +00:00
Martin Baulig
0882a71244 New example.
1998-11-02  Martin Baulig  <martin@home-of-linux.org>

	* sysdeps.c: New example.
1998-11-02 20:50:47 +00:00
Martin Baulig
213647b203 *** empty log message *** 1998-11-02 19:42:26 +00:00
Marc Ewing
44ca3f22f3 Added $(GLIB_LIBS) to libs. Not sure how it ever built without it.
1998-11-01  Marc Ewing  <marc@tasmanian.redhat.com>

        * Makefile.am: Added $(GLIB_LIBS) to libs.  Not sure
        how it ever built without it.
1998-11-02 03:20:14 +00:00
Martin Baulig
82fdca61c2 Use glibtop_warn_io_r () instead of glibtop_error_io_r ().
1998-10-31  Martin Baulig  <martin@home-of-linux.org>

	* *.c: Use glibtop_warn_io_r () instead of glibtop_error_io_r ().

	* proctime.c, prockernel.c, procargs.c: Don't call kvm_uread () if
	the /proc filesystem is not mounted.
1998-10-30 23:06:56 +00:00
Martin Baulig
0fec2b7fb0 Added code for ISDN here.
1998-10-28  Martin Baulig  <martin@home-of-linux.org>

	* ppp.c: Added code for ISDN here.
1998-10-28 21:08:41 +00:00
Martin Baulig
b70d0570c7 More network load stuff. 1998-10-26 12:21:28 +00:00
Martin Baulig
13d9120f93 Some systems may not distinguish between input and output bytes/pkts/errs
so we add `_total' fields:

typedef struct _glibtop_netload	glibtop_netload;

struct _glibtop_netload
{
	u_int64_t	flags,
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
		packets_total,		/* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		bytes_total,		/* GLIBTOP_NETLOAD_BYTES_TOTAL	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		errors_total,		/* GLIBTOP_NETLOAD_ERRORS_TOTAL	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};
1998-10-26 10:44:16 +00:00
Martin Baulig
1289b92d06 Added new features to get network load:
typedef struct _glibtop_netload	glibtop_netload;

struct _glibtop_netload
{
	u_int64_t	flags,
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};

Returns network load of the given interface, it is specified as string
like `isppp' or `ippp0':

extern void glibtop_get_netload_l __P((glibtop *, glibtop_netload *, const char *));
1998-10-26 10:39:14 +00:00
Martin Baulig
bdc4e08454 Added new feature (proc_args) to get command line arguments:
typedef struct _glibtop_proc_args	glibtop_proc_args;

struct _glibtop_proc_args
{
	u_int64_t	flags,
		size;			/* GLIBTOP_PROC_ARGS_SIZE	*/
};

Returns a string containing all command line arguments of the process,
the `unsigned' parameter is the maximum length of this string; if it
is zero then no limit will be set.

extern const char  *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
1998-10-26 09:53:08 +00:00
Martin Baulig
65e3bf19ab Set version number to 0.26.5. 1998-10-25 17:55:44 +00:00
Martin Baulig
bb545f9aaa Set version number to 0.26.4 and re-tag it `libgtop_latest_stable'. 1998-10-25 17:55:01 +00:00
Martin Baulig
30bd1f269c Small fixes. 1998-10-25 17:54:18 +00:00
Martin Baulig
9114af9fdf Added new feature to get PPP/ISDN support:
enum {
	GLIBTOP_PPP_STATE_UNKNOWN = 0,
	GLIBTOP_PPP_STATE_HANGUP,
	GLIBTOP_PPP_STATE_ONLINE
};

struct _glibtop_ppp
{
	u_int64_t	flags,
		state,			/* GLIBTOP_PPP_STATE		*/
		bytes_in,		/* GLIBTOP_PPP_BYTES_IN		*/
		bytes_out;		/* GLIBTOP_PPP_BYTES_OUT	*/
};

Currently only implemented in the FreeBSD port with ISDN via I4B. - Martin
1998-10-25 17:07:16 +00:00
Kjartan Maraas
0e57efd4e5 Updated translation.
1998-10-25  Kjartan Maraas  <kmaraas@fib.hl.no>

	* Updated translation.
1998-10-25 10:51:24 +00:00
Martin Baulig
6b548d62dd *** empty log message *** 1998-10-20 20:09:30 +00:00
Martin Baulig
afe57f9ee9 Use a 2-element-array of type `u_int64_t' for all signal masks instead of
1998-10-20  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/proc_signal.h: Use a 2-element-array of
	type `u_int64_t' for all signal masks instead of just
	scalar numbers. This avoids problems on systems with more
	than 64 signals.

	If there is any operating system out there with even more than
	128 signals, we can simply increase the number of array elements
	here.

	[NOTE for people porting libgtop:

 	 Please use all 64 bits of the `u_int64_t' and not just 32 - the
	 signal number (as it is used in calls to kill () ...) should be
	 a bit-index into this field; if a process ignores for instance
	 signal 64, it has the 0-bit of sigcatch[1] set, if it ignores 63,
	 this is the 63-bit of sigcatch[0] and so on ...

	 The mapping between signal numbers and their names is done via the
	 glibtop_sys_siglist [] field which should be declared in
	 sysdeps/@sysdeps_dir@/siglist.c - see linux for an example.
	]

	* features.def: It's now safe to put things like `loadavg[3]'
	here - the awk skripts should correctly threat this as an array.
1998-10-20 20:08:49 +00:00
Martin Baulig
38b00dfae0 Added a notice that this file *requires* libtool 1.2. It may work with 1.1
1998-10-20  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Added a notice that this file *requires*
 	libtool 1.2. It may work with 1.1 as well, but that's untested.
1998-10-20 19:16:10 +00:00
Martin Baulig
a5f0bed342 Removed this autogen'ed files. 1998-10-20 08:36:28 +00:00
Martin Baulig
1b6eb7b27d Use load-primitive' instead of load'. Make `make-docbook.sm' depend upon
1998-10-12  Martin Baulig  <martin@home-of-linux.org>

	* make-docbook.scm: Use `load-primitive' instead of `load'.
	* Makefile.am: Make `make-docbook.sm' depend upon `features.scm'
	and `dist-hook' depend upon `reference.sgml'.
1998-10-12 14:43:53 +00:00
Martin Baulig
8f4611fe34 New file. We are now using automake here. Removed. Since libgtop-docu now
1998-10-12  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: New file. We are now using automake here.
	* libgtopConf.sh: Removed. Since libgtop-docu now requires
 	LibGTop to be installed we use the installed version of this file.
	* Makefile: Removed.
1998-10-12 14:24:21 +00:00
Martin Baulig
27b46e687b Clean the $RPM_BUILD_ROOT. 1998-10-12 12:28:50 +00:00
Martin Baulig
260ecffab8 Let the user enable compiler warnings. (--with-libgtop-guile): Make the
1998-10-12  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (GNOME_COMPILE_WARNINGS): Let the user enable
	compiler warnings.
	(--with-libgtop-guile): Make the default to build the guile
	interface if guile can be found.
1998-10-12 12:28:05 +00:00
Martin Baulig
92a4453165 Added `@libs_xauth@'.
* Makefile.am (libgtop_daemon_LDADD): Added `@libs_xauth@'.
1998-10-12 10:03:32 +00:00
Martin Baulig
05eb7e1f76 Let the `Makefile' depend upon $(BUILT_SOURCES). This is required to get
1998-10-12  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Let the `Makefile' depend upon $(BUILT_SOURCES).
	This is required to get dependencies correctly.
	* names/Makefile.am: Likewise.
1998-10-11 23:01:15 +00:00
Martin Baulig
6407e9cdbf Forgot to increase LIBGTOP_INTERFACE_AGE and LIBGTOP_BINARY_AGE. 1998-10-11 22:58:57 +00:00
Martin Baulig
492c7788d0 Install feature.def' as libgtop-features.def'. Added
1998-10-12  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (confexec_DATA): Install `feature.def' as
	`libgtop-features.def'.
	* libgtop.spec: Added `%{prefix}/lib/*.def' to the file list.
1998-10-11 22:31:11 +00:00
Martin Baulig
f14684a685 Removed `sysdeps/linux/procdata.c'.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* POTFILES.in: Removed `sysdeps/linux/procdata.c'.
1998-10-11 20:36:44 +00:00
Martin Baulig
d74b27fcb9 Removed this obsolete file.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* procdata.c: Removed this obsolete file.
1998-10-11 20:35:21 +00:00
Martin Baulig
46779ed121 Don't create guile/Makefile'. Removed. (SUBDIRS): Removed guile'.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Don't create `guile/Makefile'.
	* Makefile.am (DIST_SUBDIRS): Removed.
	(SUBDIRS): Removed `guile'.
1998-10-11 20:22:35 +00:00
Martin Baulig
27a961b25d Always run libgtop_postinstall', it's :' if there's nothing to do since
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (install-exec-hook): Always run `libgtop_postinstall',
	it's `:' if there's nothing to do since the empty string is no
	valid shell syntax here.
1998-10-11 19:50:33 +00:00
Martin Baulig
a1fd1f436a Removed. This is a generated file.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* reference.sgml: Removed. This is a generated file.

	* Makefile.am: Added rule to make `reference.sgml' from
	`features.scm' using `make-docbook.scm'.
	(DISTCLEANFILES): Added `reference.sgml'.
	(EXTRA_DIST): Added `make-docbook.scm'.
	(noinst_DATA): Added `reference.sgml'.
1998-10-11 19:34:51 +00:00
Martin Baulig
bb997fff98 This directory has been moved from the `libgtop' module to the
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	This directory has been moved from the `libgtop' module to the
	`libgtop-docu' module in the GNOME CVS.

	* make-docbook.scm: Make it work with the new Guile interface
	of LibGTop from the libgtop-bindings module.

	* Makefile.am: Use the installed `features.def' file of LibGTop
	to create the `features.scm'.
1998-10-11 19:28:50 +00:00
Martin Baulig
671c02c5f2 Removed. No longer create `libgtop.so'.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* dynamic.c, dynamic_names.c: Removed.
	* Makefile.am: No longer create `libgtop.so'.
1998-10-11 18:59:05 +00:00
Martin Baulig
abf854c16a Added guile-names.x' here and a rule to make it from guile-names.c'
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* names/Makefile.am (BUILT_SOURCES, CLEANFILES): Added
 	`guile-names.x' here and a rule to make it from `guile-names.c'
 	using guile-snarf.

	* names/guile-names.awk: Use the SCM_GLOBAL_VCELL macros and
	guile-snarf here; declared all `glibtop_guile_*' functions static.
1998-10-11 18:18:14 +00:00
Martin Baulig
691ce2b843 Declared all `glibtop_guile_get_*' functions static.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* guile.awk: Declared all `glibtop_guile_get_*' functions static.
1998-10-11 18:15:45 +00:00
Martin Baulig
63e37821f3 Removed external delarations of all `glibtop_guile_*' functions that were
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/*.h: Removed external delarations of all
	`glibtop_guile_*' functions that were formerly defined in
	sysdeps/guile/guile.c and sysdeps/guile/names/guile-names.c.
1998-10-11 18:14:17 +00:00
Martin Baulig
77e926d754 New file.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* sysdeps/guile/ChangeLog: New file.
1998-10-11 16:22:47 +00:00
Martin Baulig
ade863b5e3 Added guile.x'. Added rule to make guile.x' from `guile.c' using
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (BUILT_SOURCES, CLEANFILES): Added `guile.x'.
	Added rule to make `guile.x' from `guile.c' using guile-snarf.

	* guile.awk: Use the SCM_PROC macros and guile-snarf here.
1998-10-11 16:22:28 +00:00
Martin Baulig
4aaa1f5356 Changed library order.
* (LIBGTOP_*_LIBS): Changed library order.
1998-10-11 16:20:02 +00:00
Kjartan Maraas
c965b623f9 Added norwegian translation
1998-10-11  Kjartan Maraas  <kmaraas@fib.hl.no>

	* Added norwegian translation
1998-10-11 12:42:23 +00:00
Martin Baulig
d27d97d07b Set version number to 0.26.3. Likewise.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION: Set version number to 0.26.3.
	* libgtop.spec: Likewise.
1998-10-11 11:41:14 +00:00
Martin Baulig
3af9d90f4a Added features.def'. Added --features-def-file' parameter to get
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (confexec_DATA): Added `features.def'.
	* libgtop-config.in: Added `--features-def-file' parameter
	to get pathname of installed `features.def' file.
1998-10-11 11:21:09 +00:00
Martin Baulig
70bbae9b75 Removed everything in this subdirectory. This was only experimental. The
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* perl: Removed everything in this subdirectory. This was
	only experimental. The real perl bindings for LibGTop are
	in the libgtop-bindings module.
1998-10-11 09:59:16 +00:00
Martin Baulig
669f7a6b17 Added some information here. 1998-10-10 23:22:48 +00:00
Martin Baulig
754a69a79a Removed @libs_xauth@ and -lgdbm from the _LDADD variables since libtool
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm
	from the _LDADD variables since libtool automatically gets
	the dependencies.
	* src/daemon/Makefile.am: Likewise.
	* examples/Makefile.am: Likewise.
1998-10-10 23:18:40 +00:00
Martin Baulig
e81082d8ed Removed perl/Makefile.PL' and perl/Names/Makefile.PL' from the list
of generated files.
1998-10-10 23:15:56 +00:00
Martin Baulig
f87c35d7b2 Removed the old perl targets. The only thing we need to do for the perl
subdirectoy is make a symlink from `$(srcdir)/features.def' to
`$(builddir)/perl/features.def'.
1998-10-10 23:15:13 +00:00
Martin Baulig
960d4aa3a9 New files. This is now a package of its own.
1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* configure.in, automake.sh, Automakefile.am: New files.
	This is now a package of its own.
1998-10-10 23:13:37 +00:00
Martin Baulig
34ce0648de Added names/labels/descriptions for the newly added SMP fields. 1998-10-10 21:41:57 +00:00
Martin Baulig
127baf677b Add `perl/Names/Makefile.PL.in' to the list of generated files. 1998-10-10 21:41:19 +00:00
Martin Baulig
616923612c Don't create `perl/Makefile.PL' any longer since this is done from
configure.

Create `perl/Names/Names.xs' from `perl/Names/names.awk' using features.def.
1998-10-10 21:40:19 +00:00
Martin Baulig
d1f3444da1 New directory. Defines `Libgtop::Names' module with is the Perl interface
1998-10-10  Martin Baulig  <martin@home-of-linux.org>

	* Names: New directory. Defines `Libgtop::Names' module with
	is the Perl interface of the LibGTop names library.
1998-10-10 21:39:11 +00:00
Martin Baulig
f3c73befd2 Small bug fix. 1998-10-10 19:03:39 +00:00
Martin Baulig
e894161eb2 Added `@LIBGTOP_EXTRA_LIBS@'. 1998-10-10 19:03:15 +00:00
Martin Baulig
f8fbb9198d Substitute `@LIBGTOP_EXTRA_LIBS@' for perl/Makefile.PL. 1998-10-10 18:20:58 +00:00
Martin Baulig
2af3fb1c03 Reverted last change from Federico here. 1998-10-10 18:17:48 +00:00
Martin Baulig
3b22c01a66 Added `GLIB_LIBS'.
1998-10-10  Martin Baulig  <martin@home-of-linux.org>

	* configure (LIBGTOP_EXTRA_LIBS): Added `GLIB_LIBS'.
1998-10-10 18:15:10 +00:00
Martin Baulig
4b261a3f80 *** empty log message *** 1998-10-10 17:25:52 +00:00
Martin Baulig
9b0aa47f17 New file.
1998-10-10  Martin Baulig  <martin@home-of-linux.org>

	* perl/ChangeLog: New file.
1998-10-10 17:24:14 +00:00
Martin Baulig
3af2e87c77 New file.
1998-10-10  Martin Baulig  <martin@home-of-linux.org>

	* typemap: New file.

	* perl.awk: Make it work with the new format of `features.def'.

	* Makefile.PL.in: Added typemap.

	* Libgtop.pm (new): New function.
1998-10-10 17:23:52 +00:00
Federico Mena Quintero
8014f2590b Add $(GLIB_LIBS) so that it will link.
1998-10-08  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* Makefile.am (libgtop_daemon_LDADD): Add $(GLIB_LIBS) so that it
	will link.

1998-10-01  Martin Baulig  <martin@home-of-linux.org>
1998-10-08 20:03:16 +00:00
Martin Baulig
960018d198 Updated files in `support' directory. 1998-10-07 18:32:47 +00:00
Martin Baulig
27c03c773b Updated. 1998-10-07 08:37:36 +00:00
Martin Baulig
ac2bd3eda8 Added `de'.
1998-10-07  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (ALL_LINGUAS): Added `de'.
1998-10-07 08:36:02 +00:00
Martin Baulig
b1bae173de Oops, accidentally truncated them to zero size. 1998-10-07 08:35:05 +00:00
Martin Baulig
e35db38422 New file - added german translation.
1998-10-07  Martin Baulig  <martin@home-of-linux.org>

	* de.po: New file - added german translation.

	* POTFILES.in: Regenerated.
1998-10-07 08:32:37 +00:00
Martin Baulig
95525908bf Fixed typo. 1998-10-07 08:30:26 +00:00
Martin Baulig
cf0e724f7d Removed G_GNUC_UNUSED. 1998-10-06 09:04:27 +00:00
Martin Baulig
0659b93dff Use `--with-libgtop-examples' to build the examples, they go into
a package of their own.
1998-10-04 13:30:40 +00:00
Martin Baulig
afb07a1f8b More G_GNUC_UNUSED fun. 1998-10-04 13:27:51 +00:00
Martin Baulig
d2448ea6f3 *** empty log message *** 1998-10-03 03:19:46 +00:00
Martin Baulig
dfda639756 G_GNUC_UNUSED fun and other compiler warnings ... 1998-10-03 03:19:09 +00:00
Martin Baulig
be63bf2d42 Enclosed some debugging statements in `#ifdef DEBUG'. 1998-10-03 03:01:22 +00:00
Martin Baulig
06d907146d Only include system header files if we are `_IN_LIBGTOP'.
1998-10-03  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/global.h: Only include system header files
	if we are `_IN_LIBGTOP'.
	(G_GNUC_NORETURN, G_GNUC_CONST, G_GNUC_UNUSED): Added those
	definitions if we are `_IN_LIBGTOP'.
1998-10-03 03:00:13 +00:00
Martin Baulig
bd4cd7b570 Removed.
* Makefile.am (INCLUDES): Removed.
1998-10-03 02:48:40 +00:00
Martin Baulig
a444c860d2 Use correct values for the `state' field.
1998-10-03  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c (glibtop_get_procstate_s): Use correct values for
	the `state' field.

	* proclist.c (glibtop_get_proclist_p): Honor the GLIBTOP_EXCLUDE_IDLE
	and GLIBTOP_EXCLUDE_SYSTEM flags of the `which' parameter.
1998-10-03 02:15:55 +00:00
Martin Baulig
0289863af0 Don't link it static. 1998-10-02 22:39:29 +00:00
Martin Baulig
210fc000cd You can now also use the GLIBTOP_EXCLUDE_*' flags for the which'
1998-10-02  Martin Baulig  <martin@home-of-linux.org>

	* proclist.c (glibtop_init_proclist_s): You can now also use the
	`GLIBTOP_EXCLUDE_*' flags for the `which' parameter.
1998-10-02 20:27:22 +00:00
Martin Baulig
93568304b0 Honor the `which' parameter to select which processes to fetch.
1998-10-01  Martin Baulig  <baulig@Stud.Informatik.uni-trier.de>

	* proclist.c (glibtop_init_proclist_s): Honor the `which' parameter
	to select which processes to fetch.
1998-10-01 17:04:48 +00:00
Martin Baulig
23cdbd5336 Use `libgtop_postinstall' here to make the server suid root or sgid kmem
1998-10-01  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (install-exec-hook): Use `libgtop_postinstall'
	here to make the server suid root or sgid kmem if required.
1998-10-01 08:58:55 +00:00
Nam SungHyun
17a37aa394 add 'ko' new file.
* configure.in (ALL_LINGUAS): add 'ko'
* po/ko.po: new file.
1998-09-29 10:14:45 +00:00
Martin Baulig
f082d4cb85 Examples are now in installed in $(libexecdir)/libgtop, there's no
need to move them there any longer.
1998-09-28 19:30:57 +00:00
Martin Baulig
b5c90ca5a4 Install everything in $(libexecdir)/libgtop.
1998-09-28  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am: Install everything in $(libexecdir)/libgtop.
1998-09-28 19:29:56 +00:00
Martin Baulig
f4cde0843d Applied patch from Alexander Jolk to make it work with --disable-static. 1998-09-28 17:22:41 +00:00
Martin Baulig
fce4841810 Make it really *require* GLIB >= 1.1.3.
1998-09-27  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Make it really *require* GLIB >= 1.1.3.
1998-09-27 21:25:20 +00:00
Raja R Harinath
02dfde47ab Move check for -lresolv', -lsocket' and `-lnsl' after X11 checks.
* configure.in: Move check for `-lresolv', `-lsocket' and `-lnsl'
after X11 checks.
1998-09-27 21:01:46 +00:00
Martin Baulig
a8b0903fe7 Added $(LIBGTOP_EXTRA_LIBS).
* Makefile.am (libgtop_common_la_LIBADD): Added $(LIBGTOP_EXTRA_LIBS).
1998-09-27 14:25:38 +00:00
Martin Baulig
6eed554232 Do not even check for guile if it is disabled.
1998-09-27  Martin Baulig  <martin@home-of-linux.org>

	* configure.in: Do not even check for guile if it is disabled.
1998-09-27 14:15:47 +00:00
Martin Baulig
c591e6ef33 Updated. 1998-09-27 13:34:37 +00:00
Martin Baulig
a72db75b78 Patch for `make release'. 1998-09-27 13:31:06 +00:00
Martin Baulig
8f3c38219a Set version number to 0.26.2. 1998-09-27 11:32:53 +00:00
Martin Baulig
0d56ca7d04 Applied patch from Frederic Devernay; added `include_HEADERS'. 1998-09-16 10:18:15 +00:00
Martin Baulig
70347bbfe9 Applied patch from Owen Taylor; added $GLIB_CFLAGS. 1998-09-15 19:11:03 +00:00
Martin Baulig
06437c5866 Applied another linuxism patch from Frederic Devernay. 1998-09-15 09:46:49 +00:00
Martin Baulig
72c987735e Applied patch from Frederic Devernay; use `expr' instead of bash
extension to make it follow strictly the Bourne Shell.
1998-09-15 08:06:22 +00:00
Martin Baulig
8e752ed036 Added check for -lresolv and -lnsl for Solaris. 1998-09-14 21:21:10 +00:00
Martin Baulig
36911a1239 *** empty log message *** 1998-09-12 18:06:23 +00:00
Martin Baulig
7cadf4450c New file. This is used in guname to fetch as many information about the
1998-09-12  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/sysinfo.h: New file. This is used in guname to
	fetch as many information about the system as possible like detailed
	information about hardware etc.
1998-09-12 17:55:52 +00:00
Martin Baulig
2a2677ea66 New file.
1998-09-12  Martin Baulig  <martin@home-of-linux.org>

	* sysinfo.c: New file.
1998-09-12 17:55:23 +00:00
Martin Baulig
37283cfdad LibGTop now requires glib.
1998-09-12  Martin Baulig  <martin@home-of-linux.org>

	* configure.in (AM_PATH_GLIB): LibGTop now requires glib.
1998-09-12 13:53:59 +00:00
Martin Baulig
b85a419f28 No longer link libgtop_daemon' and libgtop_server' statically. 1998-09-10 12:54:10 +00:00
Martin Baulig
507da6f040 Added SMP support. 1998-09-09 17:29:35 +00:00
Martin Baulig
11daaa2e1c Added SMP support.
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>

	* proctime.c (glibtop_get_proc_time_s): Added SMP support.
1998-09-09 16:57:13 +00:00
Martin Baulig
0d3113e6b9 Added xcpu_utime' and xcpu_stime'.
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>

	* include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime' and
	`xcpu_stime'.
1998-09-09 16:51:12 +00:00
Martin Baulig
94d7978b44 Set version to 0.26.1. 1998-09-09 16:25:20 +00:00
Martin Baulig
86de0911cc Added check for `smp_programs'. 1998-09-09 16:23:29 +00:00
Martin Baulig
8279241591 New file. Nice tool to show CPU statistics on SMP systems.
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>

	* smp.c: New file. Nice tool to show CPU statistics on SMP systems.
1998-09-09 16:22:13 +00:00
Martin Baulig
88c34d1415 *** empty log message *** 1998-09-09 15:32:44 +00:00
Martin Baulig
a331fb8e03 Added `ncpu'. This is zero for single processor systems and the number of
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>

	* glibtop.h (glibtop): Added `ncpu'. This is zero for single processor
	systems and the number of CPUs otherwise.

	* include/glibtop/cpu.h (glibtop_cpu): Added `xcpu_total', `xcpu_user',
	`xcpu_nice', `xcpu_sys' and `xcpu_idle'.
	(GLIBTOP_NCPU): #define this to 4.
1998-09-09 15:19:24 +00:00
Martin Baulig
9d564134de Initialize `ncpu' on SMP systems.
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>

	* open.c (glibtop_init_s): Initialize `ncpu' on SMP systems.

	* cpu.c (glibtop_get_cpu_s): Added SMP support.

	* ChangeLog: New file.
1998-09-09 15:17:12 +00:00
Martin Baulig
731b2879f0 Added `HAVE_LIBGTOP_SMP'. 1998-09-09 12:24:02 +00:00
Martin Baulig
2f140e2168 Bug fix. Some awk interpreters seem to have problems with `\w+'. 1998-09-08 21:06:43 +00:00
Martin Baulig
2bf9475dda Make the default to disable guile.
1998-09-08  Martin Baulig  <baulig@merkur.uni-trier.de>

	* configure.in: Make the default to disable guile.
1998-09-08 13:25:36 +00:00
Martin Baulig
6fe6cfdc15 Bug fix. 1998-09-08 13:10:55 +00:00
Martin Baulig
a6584c2f75 Added. This is a numerical constant ("1.234.567" -> 1234567) to be used in
1998-08-30  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Added. This is a numerical
	constant ("1.234.567" -> 1234567) to be used in C preprocessor
	conditionals.
1998-08-30 12:44:29 +00:00
Martin Baulig
bdefedae37 Bumped version number to 0.26.0. 1998-08-29 21:12:42 +00:00
Martin Baulig
af50e25023 Added. AC_SUBST. (LT_RELEASE, LT_CURRENT, LT_REVISION, LT_AGE): AC_SUBST.
1998-08-29  Martin Baulig  <martin@home-of-linux.org>

	* LIBGTOP-VERSION (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): Added.
	* configure.in (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): AC_SUBST.
	(LT_RELEASE, LT_CURRENT, LT_REVISION, LT_AGE): AC_SUBST.
	(LT_VERSION_INFO): Sets `-version-info' for libtool.

	* */Makefile.am: We now use the correct `-version-info' parameter
	for libtool.
1998-08-29 21:08:52 +00:00
Martin Baulig
abfda54900 This caused too much problems, so I reverted it.
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

        * configure.in (LIBGTOP_EXTRA_LIBS): Added $(LIBSUPPORT).
1998-08-27 15:18:32 +00:00
Martin Baulig
0ea8e591f4 Third argument is now `const void *'.
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/command.h (glibtop_call): Third argument is
	now `const void *'.

	* include/glibtop/xmalloc.h (glibtop_free): Now taking a
	`const void *'.
1998-08-25 08:41:02 +00:00
Martin Baulig
db3d7adbaa New file.
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

	* src/daemon/ChangeLog: New file.

	* sysdeps/sun4/ChangeLog: New file.

	* sysdeps/stub/ChangeLog: New file.

	* configure.in: Added check for `-lsocket'.
	(LIBGTOP_INCS): Added $(SUPPORTINCS).
	(INCLUDES): Added $(SUPPORTINCS).
	(LIBGTOP_EXTRA_LIBS): Added $(LIBSUPPORT).

	* acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME',
	`NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID'
	and `NEED_DECLARATION_GETPAGESIZE'.

	* includue/glibtop/global.h (<gnomesupport.h>): Include this.

	* lib/init.c (_init_server): Declared `static'.

	* lib/read_data.c: Added cast to `const void *' in calls to
	`recv' and `read' to avoid compiler warnings.
1998-08-25 08:39:14 +00:00
Martin Baulig
f353017948 Fixed some compiler warnings.
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

	* first.c, second.c, procmap.c: Fixed some compiler warnings.
1998-08-25 08:32:45 +00:00
Martin Baulig
f66f7fde8c Added prototype. Added cast to const void *' in calls to write' and
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

	* daemon.h (handle_parent_connection): Added prototype.
	* write.c, io.c: Added cast to `const void *' in calls to
	`write' and `send' to avoid compiler warnings.
	* gnuserv.c (handle_signal): Declared static.
	(main): Casting return value of `getuid' to `int' in
	debugging statement.

	* ChangeLog: New file.
1998-08-25 08:20:04 +00:00
Martin Baulig
9049a19434 Using correct `(1 << GLIBTOP_SYSDPES_*)'. (<glibtop_suid.h>): Include.
1998-08-25  Martin Baulig  <martin@home-of-linux.org>

	* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
	(<glibtop_suid.h>): Include.

	* glibtop_suid.h: New file.

	* ChangeLog: New file.
1998-08-25 08:10:05 +00:00
Martin Baulig
f7da79ed88 Added initialization functions `glibtop_init_<feature>_s'.
1998-08-24  Martin Baulig  <martin@home-of-linux.org>

	* *.c: Added initialization functions `glibtop_init_<feature>_s'.

	* ChangeLog: New file.
1998-08-24 20:44:46 +00:00
Martin Baulig
9d0aa0fdc1 Using correct (1 << GLIBTOP_SYSDPES_*)'. Removed const' from sysctl ()
1998-08-24  Martin Baulig  <martin@home-of-linux.org>

	* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
	* cpu.c, mem.c: Removed `const' from sysctl () constants to keep
	compiler happy.

	* procmem.c:  Added missing call to `glibtop_init_p'.

	* prockernel.c: Casting `nwchan' to `unsigned long' since this
	normally has the same size than a pointer. Well, is there a
	FreeBSD for 64bit architectures ?
1998-08-24 19:55:38 +00:00
Martin Baulig
fb552b8e31 Merged from LIBGTOP_0_25_PATCHES. 1998-08-24 13:09:49 +00:00
Martin Baulig
a0b502df75 Merged from `LIBGTOP_0_25_PATCHES'. 1998-08-23 12:26:32 +00:00
Martin Baulig
5a7f1d7621 Merged from LIBGTOP_0_25_PATCHES. 1998-08-22 17:26:50 +00:00
519 changed files with 40923 additions and 24700 deletions

View File

@@ -5,6 +5,8 @@ config.cache
config.h
config.h.in
config.log
config.sub
config.guess
config.status
configure
gtopConf.sh
@@ -19,9 +21,22 @@ ltconfig
ltmain.sh
macros
stamp-h
stamp-h.in
sun4
sun4sol2
support
i386-freebsd
alpha-dec-osf3.0
i686-pc-linux-gnu-linux
libgtop-config
ABOUT-NLS
libgtop.spec
libgtop-0.99.*.tar.gz
libgtop-0.99.*
install-sh
mkinstalldirs
missing
INSTALL
COPYING
glibtop-config.h
stamp-gc-h

225
ABOUT-NLS
View File

@@ -1,225 +0,0 @@
Notes on the Free Translation Project
*************************************
Free software is going international! The Free Translation Project
is a way to get maintainers of free software, translators, and users all
together, so that will gradually become able to speak many languages.
A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do *not*
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
One advise in advance
=====================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias or message inheritance) as the
implementation here. It is also not possible to offer this additional
functionality on top of a `catgets' implementation. Future versions of
GNU `gettext' will very likely convey even more functionality. So it
might be a good idea to change to GNU `gettext' as soon as possible.
So you need not provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
INSTALL Matters
===============
Some packages are "localizable" when properly installed; the
programs they contain can be made to speak your own native language.
Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system provides
usable `catgets' (if using this is selected by the installer) or
`gettext' functions. If neither is available, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is *not* required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --with-catgets
./configure --disable-nls
will respectively bypass any pre-existing `catgets' or `gettext' to use
the internationalizing routines provided within this package, enable
the use of the `catgets' functions (if found on the locale system), or
else, *totally* disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
By default the configuration process will not test for the `catgets'
function and therefore they will not be used. The reasons are already
given above: the emulation on top of `catgets' cannot provide all the
extensions provided by the GNU `gettext' library. If you nevertheless
want to use the `catgets' functions use
./configure --with-catgets
to enable the test for `catgets' (this causes no harm if `catgets' is
not available on your system). If you really select this option we
would like to hear about the reasons because we cannot think of any
good one ourself.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
ISO 639 `LL' two-letter code prior to using the programs in the
package. For example, let's suppose that you speak German. At the
shell prompt, merely execute `setenv LANG de' (in `csh'),
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
can be done from your `.login' or `.profile' file, once and for all.
An operating system might already offer message localization for
many of its programs, while other programs have been installed locally
with the full capabilities of GNU `gettext'. Just using `gettext'
extended syntax for `LANG' would break proper localization of already
available operating system programs. In this case, users should set
both `LANGUAGE' and `LANG' variables in their environment, as programs
using GNU `gettext' give preference to `LANGUAGE'. For example, some
Swedish users would rather read translations in German than English for
when Swedish is not available. This is easily accomplished by setting
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
Translating Teams
=================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list, courtesy of Linux
International. You may reach your translation team at the address
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
language. Language codes are *not* the same as the country codes given
in ISO 3166. The following translation teams exist, as of August 1997:
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
Swedish `sv', and Turkish `tr'.
For example, you may reach the Chinese translation team by writing to
`zh@li.org'.
If you'd like to volunteer to *work* at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is *not* the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
*actively* in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of August
1997. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination.
Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
.-------------------------------------------------.
bash | [] [] [] | 3
bison | [] [] [] | 3
clisp | [] [] [] [] | 4
cpio | [] [] [] [] [] | 5
diffutils | [] [] [] [] [] | 5
enscript | [] [] [] [] [] [] | 6
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
findutils | [] [] [] [] [] [] [] [] | 8
flex | [] [] [] [] | 4
gcal | [] [] [] [] [] | 5
gettext | [] [] [] [] [] [] [] [] [] [] | 11
grep | [] [] [] [] [] [] [] [] [] | 9
hello | [] [] [] [] [] [] [] [] [] [] | 10
id-utils | [] [] [] | 3
indent | [] [] [] [] | 4
libc | [] [] [] [] [] [] [] | 7
m4 | [] [] [] [] [] | 5
make | [] [] [] [] [] [] | 6
music | [] [] | 2
ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] [] [] | 9
sh-utils | [] [] [] [] [] [] [] | 7
sharutils | [] [] [] [] [] | 5
tar | [] [] [] [] [] [] [] [] [] [] | 10
texinfo | [] | 1
textutils | [] [] [] [] [] [] [] [] [] | 9
wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------------'
16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If August 1997 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites.

View File

@@ -1,95 +0,0 @@
Hi all,
I just uploaded the first working draft alpha version 0.01 to my website:
http://www.home-of-linux.org/gnome/libgtop/
Libgtop is a library that fetches information about the running system such as cpu and
memory usage, active processes etc. On Linux systems, these information are taken directly
from the /proc filesystem. For other systems such as Solaris, where such programs need to be
suid root (or only setgid kmem/mem on some systems), it provides a suid/setgid server that
fetches those information and a client-side library that talks to this server. Main idea
was to have the same interface for all operating systems, thus all system dependent details
are hidden in the implementation of that server.
Currently, it only works for Linux, documentation on how to port it to other systems is on
the way. I'm planning to keep this site an up-to-date mirror of my local machine (which is
connected to the internet over some expensive dialup connection, so I'll upload it about
once every day I made significant changes) so that you can always find the latest version
of the software here.
I've written a simple guile interface for the library to show which information it can
already fetch. See examples/third for details.
===========================================================================================
#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>
#include <glibtop/cpu.h>
int
main (int argc, char *argv [])
{
glibtop server;
glibtop_cpu cpu;
unsigned i, *ptr;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
glibtop_open (&server, argv [0]);
glibtop_get_cpu (&server, &cpu);
fprintf (stderr, "CPU: %lu, %lu, %lu, %lu, %lu\n",
cpu.total, cpu.user, cpu.nice, cpu.sys, cpu.idle);
glibtop_close (&server);
exit (0);
}
===========================================================================================
The following scheme code is used in examples/third to show all information that is
currently available:
(display (get-cpu)) (newline)
(display (get-mem)) (newline)
(display (get-swap)) (newline)
(display (get-uptime)) (newline)
(display (get-loadavg)) (newline)
(display (get-shm_limits)) (newline)
(display (get-msg_limits)) (newline)
(display (get-sem_limits)) (newline)
(display (get-sysdeps)) (newline)
(display (get-proclist)) (newline)
On my system, this yields:
(3796245 348706 66 89999 3357474)
(31715328 31354880 360448 13385728 401408 7237632 17567744)
(133885952 42160128 91725824)
(37962.49 33574.74)
(0.01 0.02 0.0)
(33554432 1 128 128 4194304)
(2048 16384 4056 16384 128 16 16384)
(4096 128 4096 4096 32 32 32 20 32767 16383)
(31 127 7 3 1 31 127 1023 3)
(71 4 284 1 2 3 246 247 210 8 48 81 83 153 157 167 170 171 172 173 174 175 178 181 195 191 200 203 207 248 215 216 217 220 222 227 245 249 250 251 253 254 315 267 331 373 338 334 335 345 337 372 374 342 343 344 375 14445 13119 6438 14555 13118 13801 6439 17362 18411 18455 6521 6522 6523 23979 23980 7905 7906)
===========================================================================================
Better documentation is on the way! There's still a little bit under the URL above.
Enjoy it!
Martin <martin@home-of-linux.org>

683
ChangeLog
View File

@@ -1,3 +1,686 @@
1999-05-28 Martin Baulig <baulig@Stud.Informatik.Uni-Trier.DE>
* include/glibtop/sysdeps.h: Remove the `GLIBTOP_SYSDEPS_FEATURES'
and `GLIBTOP_SYSDEPS_POINTER_SIZE' constants and let numbering
start at zero for `GLIBTOP_SYSDEPS_CPU'.
1999-05-28 Martin Baulig <martin@home-of-linux.org>
* glibtop.h (GLIBTOP_MOUNTENTRY_LEN): Move this
* include/glibtop/limits.h: here.
1999-05-26 Martin Baulig <martin@home-of-linux.org>
* configure.in (INCLUDES): Define `LIBGTOP_VERSION_CODE' here so we
can use version conditionals in the sysdeps code.
1999-05-25 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Make the I4B check work for NetBSD.
1999-05-15 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Remove the `--enable-hacker-mode' requirement
for the BSDI, Solaris and Digital Unix ports.
1999-05-13 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4 (GLIBTOP_SOLARIS_RELEASE): Define this on Solaris;
we use version codes like 270 for SunOS 5.7 and 251 for SunOS 2.5.1.
1999-05-12 Martin Baulig <martin@home-of-linux.org>
* glibtop-config.h: This is a new generated file which will be
included from <glibtop.h>. We define things like `u_int64_t' and
LIBGTOP_*_VERSION here so we can compile LibGTop applications with
`libgtop-config --cflags`.
* configure.in: Create glibtop-config.h.
(GLIBTOP_*_INCS): Added `-I $(pkglibdir)/include'.
* libgtop-config.h.in: Added `--cflags', `--libs' and `--extra-libs'
parameter so you can now use LibGTop even in no-autoconf apps.
* Makefile.am: Install `glibtop-config.h' in `$(pkglibdir)/include'.
1999-05-09 Drazen Kacar <dave@srce.hr>
* configure.in, acconfig.h: Added checks for <procfs.h>
and <sys/procfs.h>
1999-05-09 Martin Baulig <martin@home-of-linux.org>
* doc: One should ship the documentation of a package together with
the tarball, so I added this back.
1999-05-08 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/limits.h (GLIBTOP_MAX_GROUPS): Define this here.
* include/glibtop/procuid.h (GLIBTOP_MAX_GROUPS): Moved to limits.h.
* features.def: We can use constants from <glibtop/limits.h> here.
1999-05-08 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Use the setgid sys server for Solaris.
1999-05-06 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/sysdeps.h (glibtop_sysdeps): Added `pointer_size'
which is the number of bits of a `void *'.
1999-05-03 Martin Baulig <martin@home-of-linux.org>
Set version number to 1.1.0. Also made a `LIBGTOP_STABLE_1_0'
branch in CVS while development will go on here in the HEAD.
* LIBGTOP-VERSION: Set version number to 1.1.0 binary age 0,
interface age 0. Set LIBGTOP_SERVER_VERSION to 50.
1999-04-18 Tuomas J. Lukka <lukka@iki.fi>
* Add missing comma in sysdeps/names/proctime.c
1999-04-18 Tuomas J. Lukka <lukka@iki.fi>
* Add missing comma in sysdeps/names/cpu.c
1999-04-18 Martin Baulig <martin@home-of-linux.org>
Thanks to Drazen Kacar for pointing out that not all processors must
be running all the time under Solaris, so we need to have some flag
to find out which processors are running.
* (glibtop_cpu): Added `xcpu_flags' bitmask of running processors.
* (glibtop_proc_time): Added `xcpu_flags'.
1999-04-18 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/limits.h: New file.
(GLIBTOP_NCPU): Define this here and increase it to 64.
1999-03-30 Martin Baulig <martin@home-of-linux.org>
Added some new features.
* (glibtop_uptime): Added `boot_time', boot time in seconds
since the epoch.
* (glibtop_proc_state): Changed `state' from char to unsigned.
`uid' and `gid' are effective uid and gid; added comment.
Added `ruid' and `rgid' for guaranteed-to-be-correct real uid/gid.
For SMP systems: added `has_cpu', `processor' and `last_processor'.
* (glibtop_proc_uid): Added suid, sgid, fsuid, fsgid, ngroups, groups.
* (glibtop_proc_segment): Added start_data, end_data, start_brk,
end_brk, start_mmap, arg_start, arg_end, env_start, env_end.
* include/glibtop/procstate.h: Define some constants for the `state'
field of glibtop_proc_state.
* include/glibtop/prockernel.h: Define some constants for the
`k_flags' field of glibtop_proc_kernel.
1999-03-24 Martin Baulig <martin@home-of-linux.org>
* configure.in: Check for getloadavg () and swapctl () for
Solaris.
1999-03-23 Martin Baulig <martin@home-of-linux.org>
* glibtop.h (glibtop): Added `wanted'. Applications can set the
features they are interested in here. This way we don't waste CPU
getting expensive data that aren't really needed.
* LIBGTOP-VERSION: This breaks backward compatibility and also
added new functions; set binary age and interface age to 0.
1999-03-21 Martin Baulig <martin@home-of-linux.org>
Added a new sysctl () interface to the Linux Kernel.
* kernel/sysctl: Imported.
* libgtop-sysdeps.m4: If `--enable-hacker-mode' is given, check
for my new sysctl () interface.
1999-03-20 Martin Baulig <martin@home-of-linux.org>
Removed all traces of my old table () Linux kernel hack.
* kernel: Removed.
* sysdeps/kernel: Removed.
* libgtop-sysdeps.m4: Don't check for table (); it does not
exist any longer.
1999-03-19 Martin Baulig <martin@home-of-linux.org>
This is *untested* - please read "sysdeps/freebsd/ChangeLog" !
* libgtop-sysdeps.m4: Use the `freebsd' sysdeps directory for
BSDI as well if the `--enable-hacker-mode' parameter was given.
1999-03-18 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION: Set version number to 1.0.2 binary age 1,
intergace age 1.
1999-03-17 Martin Baulig <martin@home-of-linux.org>
Imported first version of my Solaris port.
* configure.in: Check for `kstat_open' in `-lkstat'.
* libgtop-sysdeps.m4: Recognize the `solaris' sysdeps directory
when the `--enable-hacker-mode' parameter was given.
1999-03-01 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 1.0.1.
* LIBGTOP-VERSION: Set version number to 1.0.1 binary age 0,
interface age 0.
1999-03-01 Martin Baulig <martin@home-of-linux.org>
* configure.in (LIBGTOP_LIBS): Move `-lgtop_common' last to
make it work with static-only libs. Thanks to Roderik Muit
for pointing this out.
(PERL): First check for `perl5', then for `perl'. Thanks again
to Roderik Muit.
1999-02-24 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 1.0.0.
* LIBGTOP-VERSION: Set version number to 1.0.0 binary age 0,
interface age 0.
* configure.in: Require GLIB >= 1.2.0.
1999-02-23 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.100.0.
Make the copyright of LibGTop be the GNU General Public License.
* LIBGTOP-VERSION: Set version number to 0.100.0 binary age 0,
interface age 0.
* copyright.txt: Set the year to 1998-99 and pretty-format it a
little bit. Same in all C source and header files.
1999-02-21 Martin Baulig <martin@home-of-linux.org>
* configure.in (LIBGTOP_*_INCS): Define `HAVE_GLIBTOP_MACHINE_H'
if appropriate.
1999-02-19 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.99.9.
* LIBGTOP-VERSION: Set version number to 0.99.9 binary age 0,
interface age 0.
* include/glibtop/error.h: Don't include <glib.h>.
* sysdeps/common/error.c: Use `int' not `gint'.
* misc/porting-libgtop.txt: Added a few instructions on how
to port LibGTop to Solaris.
* Replace all __BEGIN_DELCS with LIBGTOP_BEGIN_DECLS and all
__END_DECLS with LIBGTOP_END_DECLS; remove all __P macros and
use real function prototypes.
1999-02-18 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/*.h: Use glib-like function prototypes
instead of "extern <function> __P((args))".
* sysdeps/common/error.h: Replaced inline with static.
1999-02-18 Martin Baulig <martin@home-of-linux.org>
* */*.awk: Replaced all awk scripts with perl scripts since it is
more likely that people have a working perl interpreter than GNU
awk on their system.
1999-02-18 Martin Baulig <martin@home-of-linux.org>
* sysdeps/common/error.c (glibtop_error_r, glibtop_warn_r): Define
them as G_INLINE_FUNC in <glibtop/errno.h> if possible.
(glibtop_error_io_r, glibtop_warn_io_r): Likewise.
(glibtop_error_vr, glibtop_warn_vr): New functions taking a va_list.
(glibtop_error_io_vr, glibtop_warn_io_vr): New functions taking an
errno an a va_list.
1999-02-17 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.99.8.
1999-02-16 Martin Baulig <martin@home-of-linux.org>
* examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am,
sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am,
sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am,
sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am,
sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am,
sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am:
Initialize INCLUDES to `@INCLUDES@' to make it clear that it is
set in configure.in. It is ok to add things there, but you must
not remove the `@INCLUDES@'.
1999-02-15 Jeff Garzik <jgarzik@pobox.com>
* examples/Makefile.am, lib/Makefile.am, src/daemon/Makefile.am,
sysdeps/common/Makefile.am, sysdeps/guile/Makefile.am,
sysdeps/guile/names/Makefile.am, sysdeps/kernel/Makefile.am,
sysdeps/linux/Makefile.am, sysdeps/names/Makefile.am,
sysdeps/osf1/Makefile.am, sysdeps/stub/Makefile.am,
sysdeps/stub_suid/Makefile.am, sysdeps/sun4/Makefile.am:
Removed hardcoded gcc arguments from CFLAGS.
* include/glibtop/error.h:
Added FIXME comment about varargs macros breaking Sun cc
compilation.
1999-02-12 Martin Baulig <martin@home-of-linux.org>
Thanks to Frederic Devernay for pointing out that we need to define
__BEGIN_DECLS and __END_DECLS when not using GNOME.
* configure.in: Define `WITHOUT_GNOME' if appropriate.
* include/glibtop/global.h: Define __BEGIN_DECLS and __END_DECLS
when WITHOUT_GNOME not when _IN_LIBGTOP.
1999-02-12 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/global.h: Applied patch from Frederic Devernay;
__BEGIN_DECLS and __END_DECLS are only defined inside _IN_LIBGTOP.
1999-02-10 Martin Baulig <martin@home-of-linux.org>
* configure.in (program_invocation_name): Check whether we need
to declare this; some libc5 systems define that symbol but do
not declare it in any header file.
1999-02-10 Martin Baulig <martin@home-of-linux.org>
* libgtop.spec.in, libgtop.spec: Replaced libgtop.spec with
with libgtop.spec.in, so libgtop.spec is now a generated file.
1999-02-05 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/global.h: Enclose some of the stuff in this
file in `#ifdef _IN_LIBGTOP'.
1999-02-04 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/global.h (_): Use dgettext (), not gettext ().
1999-01-23 Martin Baulig <martin@home-of-linux.org>
* libgtopConf.sh.in (LIBGTOP_DATADIR): New variable.
1999-01-06 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Always enable SMP support for Linux.
1999-01-03 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.99.2.
1999-01-05 Martin Baulig <martin@home-of-linux.org>
* libgtop.spec: Always build SMP support; binary packages should
contain all possible features.
* configure.in: LibGTop will now require GLIB >= 1.1.12.
1999-01-05 Martin Baulig <martin@home-of-linux.org>
* configure.in: Make it abort if the `dc' utility is not installed.
1999-01-03 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.99.1.
1998-12-25 Martin Baulig <martin@home-of-linux.org>
* configure.in (LIBGTOP_INCS): Define `HAVE_LIBGTOP_SMP' if SMP
support was enabled.
1998-12-22 Yukihiro Nakai <Nakai@TokyoNet.AD.JP>
* configure.in (ALL_LINGUAS): Added `ja'.
1998-12-18 Martin Baulig <martin@home-of-linux.org>
* Makefile.am: Applied patch from Edward Jason Riedy to use '#'
as separator in sed commands.
1998-12-15 Martin Baulig <martin@home-of-linux.org>
Released LibGTop 0.99.0 which is a feature-freezed version
for GNOME 1.0.
1998-12-09 Martin Baulig <martin@home-of-linux.org>
* configure.in: We need to define LIBSUPPORT and SUPPORTINCS under
all circumstances as it is in gnome-libs.
* include/glibtop/procargs.h (glibtop_get_proc_args): Make the
return value a `char *' instead of a `const char *'.
1998-12-09 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION: Set version number to 0.29.1.
1998-12-09 Martin Baulig <martin@home-of-linux.org>
* libgtop-sysdeps.m4: Moved here from the macros directory,
formerly known as `macros/gnome-libgtop-sysdeps.m4'.
(--enable-hacker-mode): New command line parameter to configure,
enables building of unstable sysdeps directories.
(LIBGTOP_HACKER_TESTS): New macro to check for unsafe things when
hacker mode was enabled.
1998-12-06 Martin Baulig <martin@home-of-linux.org>
* configure.in: Make it abort if GNOME cannot be found and
the --without-gnome parameter was not given.
1998-12-03 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Pipe the expression
through `dc' so we get a real number.
1998-12-03 Martin Baulig <martin@home-of-linux.org>
LibGTop now requires gettext >= 0.10.35.
* intl: Removed &intl CVS alias.
1998-11-27 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION: Set version number to 0.29.0.
* TODO: Add things that need to be done before Dec 15.
This is basically a feature freeze for the C language part
of LibGTop except for things that are marked with (***) in
the TODO.
1998-11-20 Martin Baulig <baulig@merkur.uni-trier.de>
* sysdeps/common/mountlist.c: Applied a patch from Kenneth Stailey to
make it work on OpenBSD.
1998-11-18 Martin Baulig <martin@home-of-linux.org>
* lib/open.c (glibtop_open_l): We need to set argv[0] in call
to execl () to avoid a core dump in _init () on FreeBSD 3.0.
1998-11-11 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/gnuserv.h (MCOOKIE_SCREEN): Don't define this
any longer, we now use the port the daemon is listening on instead
of a fixed screen.
1998-11-11 Martin Baulig <martin@home-of-linux.org>
* configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG
if this parameter is given.
(--enable-fatal-warnings): New parameter to make all warnings
fatal; define `LIBGTOP_FATAL_WARNINGS' if given.
* sysdeps/common/error.c (glibtop_error_r): Use abort () instead
of exit () if LIBGTOP_ENABLE_DEBUG.
(glibtop_error_io_r): Likewise.
(glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS.
(glibtop_warn_io_r): Likewise.
[NOTE: To get a core dump of the libgtop_server, you need to
remove all suid/sgid bits and invoke it as a priviledged user.]
1998-11-08 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (support): Don't build if not BUILD_GNOME_SUPPORT.
1998-11-02 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/parameter.h: Added `GLIBTOP_PARAM_REQUIRED'.
* lib/parameter.c (glibtop_set_parameter_l): It's no longer
allowed to set GLIBTOP_PARAM_FEATURES.
(glibtop_get_parameter_l): You can use `GLIBTOP_PARAM_REQUIRED'
to read server->required and ...
(glibtop_set_parameter_l): ... set it here.
1998-10-26 Martin Baulig <martin@home-of-linux.org>
Added `Network Load' feature (netload).
* include/glibtop/netload.h: New file.
* features.def: Added new feature `netload'.
1998-10-26 Martin Baulig <martin@home-of-linux.org>
Added `Command Line Parameters' feature (proc_args).
* include/glibtop/proc_args.h: New file.
* features.def: Added new feature `proc_args'.
* lib/lib.awk: New type `unsigned' for the features.def which
is `unsigned'.
1998-10-25 Martin Baulig <martin@home-of-linux.org>
Added PPP/ISDN support.
* include/glibtop/ppp.h: New file.
* features.def: Added new feature `ppp'.
* acconfig.h (HAVE_I4B): Defined if we have the I4B package.
(HAVE_I4B_ACCT): Defined if we have ISDN statistics with I4B.
* misc: New directory.
* misc/i4b_acct.txt: Read this file to get ISDN statistics on BSD.
* lib/lib.awk: New type `ushort' for the features.def which is
`unsigned short'.
1998-10-20 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/proc_signal.h: Use a 2-element-array of
type `u_int64_t' for all signal masks instead of just
scalar numbers. This avoids problems on systems with more
than 64 signals.
If there is any operating system out there with even more than
128 signals, we can simply increase the number of array elements
here.
[NOTE for people porting libgtop:
Please use all 64 bits of the `u_int64_t' and not just 32 - the
signal number (as it is used in calls to kill () ...) should be
a bit-index into this field; if a process ignores for instance
signal 64, it has the 0-bit of sigcatch[1] set, if it ignores 63,
this is the 63-bit of sigcatch[0] and so on ...
The mapping between signal numbers and their names is done via the
glibtop_sys_siglist [] field which should be declared in
sysdeps/@sysdeps_dir@/siglist.c - see linux for an example.
]
* features.def: It's now safe to put things like `loadavg[3]'
here - the awk skripts should correctly threat this as an array.
1998-10-12 Martin Baulig <martin@home-of-linux.org>
* configure.in (GNOME_COMPILE_WARNINGS): Let the user enable
compiler warnings.
(--with-libgtop-guile): Make the default to build the guile
interface if guile can be found.
* Makefile.am (confexec_DATA): Install `feature.def' as
`libgtop-features.def'.
* libgtop.spec: Added `%{prefix}/lib/*.def' to the file list.
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* configure.in: Don't create `guile/Makefile'.
* Makefile.am (DIST_SUBDIRS): Removed.
(SUBDIRS): Removed `guile'.
* include/glibtop/*.h: Removed external delarations of all
`glibtop_guile_*' functions that were formerly defined in
sysdeps/guile/guile.c and sysdeps/guile/names/guile-names.c.
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* sysdeps/guile/ChangeLog: New file.
* LIBGTOP-VERSION: Set version number to 0.26.3.
* libgtop.spec: Likewise.
* Makefile.am (confexec_DATA): Added `features.def'.
* libgtop-config.in: Added `--features-def-file' parameter
to get pathname of installed `features.def' file.
* perl: Removed everything in this subdirectory. This was
only experimental. The real perl bindings for LibGTop are
in the libgtop-bindings module.
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm
from the _LDADD variables since libtool automatically gets
the dependencies.
* src/daemon/Makefile.am: Likewise.
* examples/Makefile.am: Likewise.
1998-10-10 Martin Baulig <martin@home-of-linux.org>
* configure (LIBGTOP_EXTRA_LIBS): Added `GLIB_LIBS'.
* perl/ChangeLog: New file.
1998-10-07 Martin Baulig <martin@home-of-linux.org>
* configure.in (ALL_LINGUAS): Added `de'.
1998-10-03 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/global.h: Only include system header files
if we are `_IN_LIBGTOP'.
(G_GNUC_NORETURN, G_GNUC_CONST, G_GNUC_UNUSED): Added those
definitions if we are `_IN_LIBGTOP'.
1998-09-29 Sung-Hyun Nam <namsh@lgic.co.kr>
* configure.in (ALL_LINGUAS): add `ko'
* po/ko.po: new file.
1998-09-27 Martin Baulig <martin@home-of-linux.org>
* configure.in: Make it really *require* GLIB >= 1.1.3.
1998-09-27 Raja R Harinath <harinath@cs.umn.edu>
* configure.in: Move check for `-lresolv', `-lsocket' and `-lnsl'
after X11 checks.
1998-09-27 Martin Baulig <martin@home-of-linux.org>
* configure.in: Do not even check for guile if it is disabled.
1998-09-12 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/sysinfo.h: New file. This is used in guname to
fetch as many information about the system as possible like detailed
information about hardware etc.
* configure.in (AM_PATH_GLIB): LibGTop now requires glib.
1998-09-09 Martin Baulig <baulig@Stud.Informatik.uni-trier.de>
* include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime'
and `xcpu_stime'.
* sysdeps/linux/ChangeLog: New file.
* glibtop.h (glibtop): Added `ncpu'. This is zero for single processor
systems and the number of CPUs otherwise.
* include/glibtop/cpu.h (glibtop_cpu): Added `xcpu_total', `xcpu_user',
`xcpu_nice', `xcpu_sys' and `xcpu_idle'.
(GLIBTOP_NCPU): #define this to 4.
1998-09-08 Martin Baulig <baulig@merkur.uni-trier.de>
* configure.in: Make the default to disable guile.
1998-08-30 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Added. This is a numerical
constant ("1.234.567" -> 1234567) to be used in C preprocessor
conditionals.
1998-08-29 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): Added.
* configure.in (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): AC_SUBST.
(LT_RELEASE, LT_CURRENT, LT_REVISION, LT_AGE): AC_SUBST.
(LT_VERSION_INFO): Sets `-version-info' for libtool.
* */Makefile.am: We now use the correct `-version-info' parameter
for libtool.
1998-08-25 Martin Baulig <martin@home-of-linux.org>
* include/glibtop/command.h (glibtop_call): Third argument is
now `const void *'.
* include/glibtop/xmalloc.h (glibtop_free): Now taking a
`const void *'.
1998-08-25 Martin Baulig <martin@home-of-linux.org>
* src/daemon/ChangeLog: New file.
* sysdeps/sun4/ChangeLog: New file.
* sysdeps/stub/ChangeLog: New file.
* configure.in: Added check for `-lsocket'.
(LIBGTOP_INCS): Added $(SUPPORTINCS).
(INCLUDES): Added $(SUPPORTINCS).
* acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME',
`NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID'
and `NEED_DECLARATION_GETPAGESIZE'.
* includue/glibtop/global.h (<gnomesupport.h>): Include this.
* lib/init.c (_init_server): Declared `static'.
* lib/read_data.c: Added cast to `const void *' in calls to
`recv' and `read' to avoid compiler warnings.
* configure.in (INCLUDES): No longer using installed header files.
1998-08-23 Martin Baulig <martin@home-of-linux.org>
* features.def (mountlist): Using `int(fs_usage)'.
1998-08-21 Martin Baulig <martin@home-of-linux.org>
* ANNOUNCE-0.25: Released LibGTop 0.25 stable.
1998-08-18 Martin Baulig <martin@home-of-linux.org>
* LIBGTOP-VERSION: Set version number to 0.25.0. There is now really

View File

@@ -1,10 +1,24 @@
LIBGTOP_MAJOR_VERSION=0
LIBGTOP_MINOR_VERSION=25
# Making releases:
# LIBGTOP_MICRO_VERSION += 1;
# LIBGTOP_INTERFACE_AGE += 1;
# LIBGTOP_BINARY_AGE += 1;
# if any functions have been added, set LIBGTOP_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set LIBGTOP_BINARY_AGE and LIBGTOP_INTERFACE_AGE to 0.
#
LIBGTOP_MAJOR_VERSION=1
LIBGTOP_MINOR_VERSION=1
LIBGTOP_MICRO_VERSION=0
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
LIBGTOP_INTERFACE_AGE=0
LIBGTOP_BINARY_AGE=0
# Increase each time you change the client/server protocol.
LIBGTOP_SERVER_VERSION=1
LIBGTOP_SERVER_VERSION=50
# Don't change this
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
LIBGTOP_VERSION_CODE=`echo "$LIBGTOP_MAJOR_VERSION 1000000 * $LIBGTOP_MINOR_VERSION 1000 * + $LIBGTOP_MICRO_VERSION + p q" | dc`
# For automake.
VERSION=$LIBGTOP_VERSION

View File

@@ -6,101 +6,92 @@ else
examples_SUBDIRS =
endif
if GUILE
guile_SUBDIRS = guile
else
guile_SUBDIRS =
if BUILD_GNOME_SUPPORT
support = support
endif
SUBDIRS = po intl support macros include sysdeps lib src \
$(examples_SUBDIRS)
DIST_SUBDIRS = po intl support macros include sysdeps src lib guile examples
SUBDIRS = po intl $(support) macros misc include sysdeps lib src \
$(examples_SUBDIRS) doc
include_HEADERS = glibtop.h
configincludedir = $(pkglibdir)/include
EXTRA_DIST = autogen.sh libgtop.spec copyright.txt libgtopConf.sh.in \
LIBGTOP-VERSION features.def perl/Makefile.PL.in perl/perl.awk \
perl/MANIFEST perl/Changes libgtop-config.in RELNOTES-0.25
EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt libgtopConf.sh.in \
LIBGTOP-VERSION features.def libgtop-config.in RELNOTES-0.25 \
RELNOTES-1.0 libgtop-sysdeps.m4 README NEWS.old libgtop-mirror.sh
configinclude_DATA = \
glibtop-config.h
BUILT_SOURCES = stamp-gc-h #note: not glibtop-config.h
glibtop-config.h: stamp-gc-h
@:
stamp-gc-h: config.status
CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=glibtop-config.h ./config.status
echo timestamp > stamp-gc-h
dist-hook:
cp libgtop.spec $(distdir)
release:
$(MAKE) dist distdir=$(PACKAGE)$(VERSION)
$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)
## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'.
confexecdir=$(libdir)
confexec_DATA = $(top_builddir)/libgtopConf.sh
confexecdir = $(libdir)
confexec_DATA = $(top_builddir)/libgtopConf.sh \
$(top_builddir)/libgtop-features.def
bin_SCRIPTS = $(top_builddir)/libgtop-config
noinst_DATA = $(top_builddir)/perl/Makefile.PL \
$(top_builddir)/perl/Libgtop.xs
## to automatically rebuild aclocal.m4 if any of the macros in
## `macros/' change
@MAINT@include macros/macros.dep
@MAINT@ include macros/macros.dep
@MAINT@macros/macros.dep: macros/Makefile.am
@MAINT@ cd macros && $(MAKE) macros.dep
@MAINT@$(top_srcdir)/aclocal.m4: libgtop-sysdeps.m4
## We create libgtopConf.sh here and not from configure because we want
## to get the paths expanded correctly. Macros like srcdir are given
## the value NONE in configure if the user doesn't specify them (this
## is an autoconf feature, not a bug).
libgtopConf.sh: libgtopConf.sh.in Makefile
## Use sed and then mv to avoid problems if the user interrupts.
sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
-e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
-e 's,\@LIBGTOP_EXTRA_LIBS\@,$(LIBGTOP_EXTRA_LIBS),g' \
-e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
-e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
-e 's,\@LIBGTOP_NAMES_LIBS\@,$(LIBGTOP_NAMES_LIBS),g' \
-e 's,\@LIBGTOP_NAMES_INCS\@,$(LIBGTOP_NAMES_INCS),g' \
-e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
-e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
-e 's,\@LIBGTOP_GUILE_NAMES_LIBS\@,$(LIBGTOP_GUILE_NAMES_LIBS),g' \
-e 's,\@LIBGTOP_GUILE_NAMES_INCS\@,$(LIBGTOP_GUILE_NAMES_INCS),g' \
-e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
-e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
-e 's,\@LIBGTOP_MAJOR_VERSION\@,$(LIBGTOP_MAJOR_VERSION),g' \
-e 's,\@LIBGTOP_MINOR_VERSION\@,$(LIBGTOP_MINOR_VERSION),g' \
-e 's,\@LIBGTOP_MICRO_VERSION\@,$(LIBGTOP_MICRO_VERSION),g' \
-e 's,\@LIBGTOP_VERSION\@,$(LIBGTOP_VERSION),g' \
-e 's,\@LIBGTOP_SERVER_VERSION\@,$(LIBGTOP_SERVER_VERSION),g' \
-e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
-e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
-e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
-e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
-e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
sed -e 's#\@LIBGTOP_LIBDIR\@#$(libdir)#g' \
-e 's#\@LIBGTOP_INCLUDEDIR\@#$(includedir)#g' \
-e 's#\@LIBGTOP_DATADIR\@#$(datadir)#g' \
-e 's#\@LIBGTOP_EXTRA_LIBS\@#$(LIBGTOP_EXTRA_LIBS)#g' \
-e 's#\@LIBGTOP_LIBS\@#$(LIBGTOP_LIBS)#g' \
-e 's#\@LIBGTOP_INCS\@#$(LIBGTOP_INCS)#g' \
-e 's#\@LIBGTOP_NAMES_LIBS\@#$(LIBGTOP_NAMES_LIBS)#g' \
-e 's#\@LIBGTOP_NAMES_INCS\@#$(LIBGTOP_NAMES_INCS)#g' \
-e 's#\@LIBGTOP_GUILE_LIBS\@#$(LIBGTOP_GUILE_LIBS)#g' \
-e 's#\@LIBGTOP_GUILE_INCS\@#$(LIBGTOP_GUILE_INCS)#g' \
-e 's#\@LIBGTOP_GUILE_NAMES_LIBS\@#$(LIBGTOP_GUILE_NAMES_LIBS)#g' \
-e 's#\@LIBGTOP_GUILE_NAMES_INCS\@#$(LIBGTOP_GUILE_NAMES_INCS)#g' \
-e 's#\@LIBGTOP_BINDIR\@#$(LIBGTOP_BINDIR)#g' \
-e 's#\@LIBGTOP_SERVER\@#$(LIBGTOP_SERVER)#g' \
-e 's#\@LIBGTOP_MAJOR_VERSION\@#$(LIBGTOP_MAJOR_VERSION)#g' \
-e 's#\@LIBGTOP_MINOR_VERSION\@#$(LIBGTOP_MINOR_VERSION)#g' \
-e 's#\@LIBGTOP_MICRO_VERSION\@#$(LIBGTOP_MICRO_VERSION)#g' \
-e 's#\@LIBGTOP_VERSION\@#$(LIBGTOP_VERSION)#g' \
-e 's#\@LIBGTOP_VERSION_CODE\@#$(LIBGTOP_VERSION_CODE)#g' \
-e 's#\@LIBGTOP_SERVER_VERSION\@#$(LIBGTOP_SERVER_VERSION)#g' \
-e 's#\@libgtop_sysdeps_dir\@#$(libgtop_sysdeps_dir)#g' \
-e 's#\@libgtop_need_server\@#$(libgtop_need_server)#g' \
-e 's#\@libgtop_use_machine_h\@#$(libgtop_use_machine_h)#g' \
-e 's#\@libgtop_guile_found\@#$(libgtop_guile_found)#g' \
-e 's#\@libgtop_want_examples\@#$(libgtop_want_examples)#g' \
< $(srcdir)/libgtopConf.sh.in > libgtopConf.tmp \
&& mv libgtopConf.tmp libgtopConf.sh
libgtop-config: libgtop-config.in Makefile
sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
sed -e 's#\@LIBGTOP_LIBDIR\@#$(libdir)#g' \
< $(srcdir)/libgtop-config.in > libgtop-config.tmp \
&& mv libgtop-config.tmp libgtop-config && \
chmod 755 libgtop-config
perl/Makefile.PL: perl/Makefile.PL.in Makefile
## Use sed and then mv to avoid problems if the user interrupts.
sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
-e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
-e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
-e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
-e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
-e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
-e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
-e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
-e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
-e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
-e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
-e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
-e 's,\@libgtop_want_names\@,$(libgtop_want_names),g' \
-e 's,\@libgtop_want_guile_names\@,$(libgtop_want_guile_names),g' \
-e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
< $(srcdir)/perl/Makefile.PL.in > perl/Makefile.tmp \
&& mv perl/Makefile.tmp perl/Makefile.PL
libgtop-features.def: features.def
@LN_S@ $< $@
perl/Libgtop.xs: perl/perl.awk $(top_builddir)/config.h $(top_srcdir)/features.def
$(AWK) -f $(top_srcdir)/perl/perl.awk < $(top_srcdir)/features.def > perl/lgt-t
mv perl/lgt-t perl/Libgtop.xs

244
NEWS
View File

@@ -1,244 +0,0 @@
$Id$
Jun/01/1998
===========
* We have some new ``suffix rules'':
'__l' is a function defined in the client part;
'__s' is a function defined in the sysdeps part and
'__p' is a function that needs special priviledges.
'__r' is mapped either on '__p' or on '__s'.
the function without suffix is mapped on '__l'.
* We now decide at runtime whether or not using the server
is required for a particular function. All user programs
now call the '__l' function defined in '-lgtop' (in the lib
subdir). These functions either use 'glibtop_call__l' to
call the server or call the '__r' function.
* A function in the sysdeps directory now has the '__s' suffix
if it do not need any priviledges (and thus can be called directly
from client code) and the '__p' suffix otherwise (when it has to
be called from the server).
* If you call one of these functions:
-> use the '__p' suffix to be sure to get the SUID-safe one
(used in the server).
-> use the '__s' suffix to be sure to get a function that
doesn't need any priviledges.
-> use the '__r' suffix otherwise (it is mapped either on the
'__p' or on the '__s' one).
Only use the '__p' and '__s' functions in a 'GLIBTOP_SUID_<feature>'
conditional, otherwise you'll get undefined symbols !
* The server is now started from 'glibtop_init__r', but only when
it's really needed; for instance on DEC OSF/1 you only need it
for the proc* features - if you program only fetches the CPU usage,
now server will be started.
* Sorry, at the moment everything is a little bit unstable, I'm doing
heavy changes. I've just some great ideas which still need some work:
-> I want to have a SUID server that only implements those features
that need to be SUID; everything else uses the sysdeps code directly.
-> If a program only uses stuff that do not need the server, the
server will not be started at all.
-> I'm working on some kind of proxy server that can be used on a remote
host; in feature one can then use the MDI stuff from ghex in gtop to
have notebook pages displaying processes from different hosts.
* Well it is as much unstable that it only works under Linux at the moment.
1998-06-01 Martin Baulig <martin@home-of-linux.org>
* sysdeps/common/sysdeps.c: now using '__r' functions,
they are #defined either as the '__p' or the '__s' ones.
* sysdeps/linux/*.c: changed call of 'glibtop_init__r',
it now takes two additional arguments.
* examples/{first.c, second.c}: now using 'glibtop_init'
instead of 'glibtop_init__r'.
* include/glibtop/sysdeps.h: added 'dummy' member so
'GLIBTOP_SYSDEPS_<feature>' now start with 1.
* include/glibtop/*.h: we now #define 'glibtop_get_<feature>'
as 'glibtop_get_<feature>__l' and 'glibtop_get_<feature>__r'
either as the '__p' or the '__s' function.
* lib/*.c: removed #if's - we now decide at runtime
whether to use the server or to call the appropriate
function for the sysdeps directory.
1998-05-28 Martin Baulig <baulig@merkur.uni-trier.de>
* src/server/main.c: we now use the '__p' functions,
but only if the appropriate 'GLIBTOP_SUID_<feature>'
has a non-zero value.
* configure.in (@machine_incs@): always use
`-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no
longer conditional.
* examples/Makefile.am: removed the '_linux' examples.
* sysdeps/linux/*.c: renamed all functions implementing
features to '__s'.
* lib/*.c: renamed all functions implementing features
to '__l'; we only emit code for those functions if the
corresponding 'GLIBTOP_SUID_<feature>' has a positive value.
* include/glibtop/*.h: added some new function suffixes:
'__l' is a function defined in the client part;
'__s' is a function defined in the sysdeps part and
'__p' is a function that needs special priviledges.
'__r' is mapped either on '__l' or on '__s'.
* sysdeps/linux/glibtop_server.h: New file -
defines system dependent constants 'GLIBTOP_SUID_<feature>'
being either 'GLIBTOP_SYSDEPS_<feature>'+1 depending upon
whether or not this feature requires using the server.
* lib/sysdeps.c: removed that file; it is no longer
needed.
May/21/1998
===========
* doc/gnome-hackers.sgml: This is a short intro on how to use libgtop
in the GNOME project. It covers especially the use of its 'configure'
script and the automatically generated 'gtopConf.sh'.
May/20/1998
===========
* 'gtopConf.sh' now defines 'GTOP_LIBS' and 'GTOP_INCS' in a manner
that they contain everything that is needed to link some program with
libgtop. It will use '-lgtop' only if the server is really needed and
'-lgtop_sysdeps' otherwise;
* 'gtopConf.sh' additionally defines 'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS'
containing everything that is needed to link some program both with
libgtop and its guile interface. They are identically to 'GTOP_LIBS'
and 'GTOP_INCS' if building the guile interface is disabled or guile
cannot be found on the system.
* 'configure' takes additional arguments '--enable-libgtop-server' and
'--disable-libgtop-server' to use the server even when it's not needed
or to disable it's use where it's needed.
* 'configure' takes an argument '--without-libgtop-guile' to disable
guile support.
* 'configure takes an argument '--without-libgtop-names' to remove
'-lgtop_names' (and '-lgtop_guile_names' when we have guile) from
'GTOP_LIBS'; in this case these libraries are not even built.
May/19/1998
===========
* Libgtop is now in the GNOME CVS Repository.
May/17/1998
===========
* we have now 'const char *glibtop_types_* []' consisting
of the C types of the corresponding files of '_glibtop_*'.
* added guile function '(glibtop-types-*)' and '(glibtop-descriptions-*)'.
May/10/1998
===========
* Port to DEC OSF1 3.0 has been made:
cpu (total, user, nice, sys, idle)
mem (total, used, free)
loadavg (loadavg)
uptime (uptime)
msg_limits (map, max, mnb, mni, tql)
sem_limits (mni, msl, opm, vmx, aem)
shm_limits (max, min, mni, seg)
The following need the server to be SUID root:
proclist (total, number, size)
procdata (cmd, state, uid, pid, ppid, pgrp, tty, k_flags,
session, tpgid, sigignore, sigcatch, signal, nice,
priority, resident, rss, vsize, utime, stime,
cutime, cstime, trs, drs)
May/07/1998
===========
* 'flags' member of sysdeps/linux/procdata.c is now
'unsigned long flags [2]'.
* When we give glibtop_get_procdata () a pid of zero, only
the flags are returned.
* We now use static constants instead of #defines for sysdeps flags.
May/03/1998
===========
* VPATH-Build now working; sometimes it's necessary to copy
$(top_srcdir)/po/cat-id-tbl.c to $(top_builddir)/po.
* The library has been tested on the following systems:
- i686-pc-linux-gnu
- sparc-sun-sunos4.1.1
- alpha-dec-osf1 (that's DEC OSF1 3.0 and 3.2)
* Compilation has been tested on the following systems (I have no root
access there and cannot test the library because of this):
- sparc-sun-solaris2
- i386-bsdi
* Does no longer require Gnome.
* Guile-Parts are compiled only if guile can be found.
* Some of the executables are statically linked to copy them more easily
between machines.
May/02/1998
===========
* Global changes to the interfaces, all functions except glibtop_open()
and glibtop_close() that took a server argument have now a '__r' suffix;
the original name is now a macro that uses glibtop_global_server.
Apr/10/1998
===========
Added new directory sysdeps/guile/names. It is the guile interface
to the gtop_names library found in sysdeps/names. Changed
GLIBTOP_DESCRIPTIONS to GLIBTOP_NAMES and added GLIBTOP_GUILE_NAMES
to the header files.
Apr/09/1998
===========
Added new directories guile and names to sysdeps. In names are
some string constants about the data stored in the structures.
guile is a guile interface for the library. It is used in
examples/third (which has been completely rewritten).
The header files define things from names when GLIBTOP_DESCRIPTIONS
if defined and/or from guile when HAVE_GUILE is defined.
Apr/08/1998
===========
Added guile wrapper for the library (see examples/third).

244
NEWS.old Normal file
View File

@@ -0,0 +1,244 @@
$Id$
Jun/01/1998
===========
* We have some new ``suffix rules'':
'__l' is a function defined in the client part;
'__s' is a function defined in the sysdeps part and
'__p' is a function that needs special priviledges.
'__r' is mapped either on '__p' or on '__s'.
the function without suffix is mapped on '__l'.
* We now decide at runtime whether or not using the server
is required for a particular function. All user programs
now call the '__l' function defined in '-lgtop' (in the lib
subdir). These functions either use 'glibtop_call__l' to
call the server or call the '__r' function.
* A function in the sysdeps directory now has the '__s' suffix
if it do not need any priviledges (and thus can be called directly
from client code) and the '__p' suffix otherwise (when it has to
be called from the server).
* If you call one of these functions:
-> use the '__p' suffix to be sure to get the SUID-safe one
(used in the server).
-> use the '__s' suffix to be sure to get a function that
doesn't need any priviledges.
-> use the '__r' suffix otherwise (it is mapped either on the
'__p' or on the '__s' one).
Only use the '__p' and '__s' functions in a 'GLIBTOP_SUID_<feature>'
conditional, otherwise you'll get undefined symbols !
* The server is now started from 'glibtop_init__r', but only when
it's really needed; for instance on DEC OSF/1 you only need it
for the proc* features - if you program only fetches the CPU usage,
now server will be started.
* Sorry, at the moment everything is a little bit unstable, I'm doing
heavy changes. I've just some great ideas which still need some work:
-> I want to have a SUID server that only implements those features
that need to be SUID; everything else uses the sysdeps code directly.
-> If a program only uses stuff that do not need the server, the
server will not be started at all.
-> I'm working on some kind of proxy server that can be used on a remote
host; in feature one can then use the MDI stuff from ghex in gtop to
have notebook pages displaying processes from different hosts.
* Well it is as much unstable that it only works under Linux at the moment.
1998-06-01 Martin Baulig <martin@home-of-linux.org>
* sysdeps/common/sysdeps.c: now using '__r' functions,
they are #defined either as the '__p' or the '__s' ones.
* sysdeps/linux/*.c: changed call of 'glibtop_init__r',
it now takes two additional arguments.
* examples/{first.c, second.c}: now using 'glibtop_init'
instead of 'glibtop_init__r'.
* include/glibtop/sysdeps.h: added 'dummy' member so
'GLIBTOP_SYSDEPS_<feature>' now start with 1.
* include/glibtop/*.h: we now #define 'glibtop_get_<feature>'
as 'glibtop_get_<feature>__l' and 'glibtop_get_<feature>__r'
either as the '__p' or the '__s' function.
* lib/*.c: removed #if's - we now decide at runtime
whether to use the server or to call the appropriate
function for the sysdeps directory.
1998-05-28 Martin Baulig <baulig@merkur.uni-trier.de>
* src/server/main.c: we now use the '__p' functions,
but only if the appropriate 'GLIBTOP_SUID_<feature>'
has a non-zero value.
* configure.in (@machine_incs@): always use
`-I$(top_srcdir)/sysdeps/@sysdeps_dir@'; it's no
longer conditional.
* examples/Makefile.am: removed the '_linux' examples.
* sysdeps/linux/*.c: renamed all functions implementing
features to '__s'.
* lib/*.c: renamed all functions implementing features
to '__l'; we only emit code for those functions if the
corresponding 'GLIBTOP_SUID_<feature>' has a positive value.
* include/glibtop/*.h: added some new function suffixes:
'__l' is a function defined in the client part;
'__s' is a function defined in the sysdeps part and
'__p' is a function that needs special priviledges.
'__r' is mapped either on '__l' or on '__s'.
* sysdeps/linux/glibtop_server.h: New file -
defines system dependent constants 'GLIBTOP_SUID_<feature>'
being either 'GLIBTOP_SYSDEPS_<feature>'+1 depending upon
whether or not this feature requires using the server.
* lib/sysdeps.c: removed that file; it is no longer
needed.
May/21/1998
===========
* doc/gnome-hackers.sgml: This is a short intro on how to use libgtop
in the GNOME project. It covers especially the use of its 'configure'
script and the automatically generated 'gtopConf.sh'.
May/20/1998
===========
* 'gtopConf.sh' now defines 'GTOP_LIBS' and 'GTOP_INCS' in a manner
that they contain everything that is needed to link some program with
libgtop. It will use '-lgtop' only if the server is really needed and
'-lgtop_sysdeps' otherwise;
* 'gtopConf.sh' additionally defines 'GTOP_GUILE_LIBS' and 'GTOP_GUILE_INCS'
containing everything that is needed to link some program both with
libgtop and its guile interface. They are identically to 'GTOP_LIBS'
and 'GTOP_INCS' if building the guile interface is disabled or guile
cannot be found on the system.
* 'configure' takes additional arguments '--enable-libgtop-server' and
'--disable-libgtop-server' to use the server even when it's not needed
or to disable it's use where it's needed.
* 'configure' takes an argument '--without-libgtop-guile' to disable
guile support.
* 'configure takes an argument '--without-libgtop-names' to remove
'-lgtop_names' (and '-lgtop_guile_names' when we have guile) from
'GTOP_LIBS'; in this case these libraries are not even built.
May/19/1998
===========
* Libgtop is now in the GNOME CVS Repository.
May/17/1998
===========
* we have now 'const char *glibtop_types_* []' consisting
of the C types of the corresponding files of '_glibtop_*'.
* added guile function '(glibtop-types-*)' and '(glibtop-descriptions-*)'.
May/10/1998
===========
* Port to DEC OSF1 3.0 has been made:
cpu (total, user, nice, sys, idle)
mem (total, used, free)
loadavg (loadavg)
uptime (uptime)
msg_limits (map, max, mnb, mni, tql)
sem_limits (mni, msl, opm, vmx, aem)
shm_limits (max, min, mni, seg)
The following need the server to be SUID root:
proclist (total, number, size)
procdata (cmd, state, uid, pid, ppid, pgrp, tty, k_flags,
session, tpgid, sigignore, sigcatch, signal, nice,
priority, resident, rss, vsize, utime, stime,
cutime, cstime, trs, drs)
May/07/1998
===========
* 'flags' member of sysdeps/linux/procdata.c is now
'unsigned long flags [2]'.
* When we give glibtop_get_procdata () a pid of zero, only
the flags are returned.
* We now use static constants instead of #defines for sysdeps flags.
May/03/1998
===========
* VPATH-Build now working; sometimes it's necessary to copy
$(top_srcdir)/po/cat-id-tbl.c to $(top_builddir)/po.
* The library has been tested on the following systems:
- i686-pc-linux-gnu
- sparc-sun-sunos4.1.1
- alpha-dec-osf1 (that's DEC OSF1 3.0 and 3.2)
* Compilation has been tested on the following systems (I have no root
access there and cannot test the library because of this):
- sparc-sun-solaris2
- i386-bsdi
* Does no longer require Gnome.
* Guile-Parts are compiled only if guile can be found.
* Some of the executables are statically linked to copy them more easily
between machines.
May/02/1998
===========
* Global changes to the interfaces, all functions except glibtop_open()
and glibtop_close() that took a server argument have now a '__r' suffix;
the original name is now a macro that uses glibtop_global_server.
Apr/10/1998
===========
Added new directory sysdeps/guile/names. It is the guile interface
to the gtop_names library found in sysdeps/names. Changed
GLIBTOP_DESCRIPTIONS to GLIBTOP_NAMES and added GLIBTOP_GUILE_NAMES
to the header files.
Apr/09/1998
===========
Added new directories guile and names to sysdeps. In names are
some string constants about the data stored in the structures.
guile is a guile interface for the library. It is used in
examples/third (which has been completely rewritten).
The header files define things from names when GLIBTOP_DESCRIPTIONS
if defined and/or from guile when HAVE_GUILE is defined.
Apr/08/1998
===========
Added guile wrapper for the library (see examples/third).

59
README
View File

@@ -1,57 +1,8 @@
Hi all,
$Id$
[PLEASE READ THE FILE ``README.LATEST'' FOR LATEST NEWS]
this is the latest alpha version of libgtop, a library that fetches
information about the running system such as cpu and memory usage,
active processes etc. On Linux systems, these information are taken
directly from the /proc filesystem. For other systems such as Solaris,
where such programs need to be suid root (or only setgid kmem/mem on
some systems), it provides a suid/setgid server that fetches those
information and a client-side library that talks to this server.
Main idea was to have the same interface for all operating systems,
thus all system dependent details are hidden in the implementation
of that server.
Currently, it only works for Linux, documentation on how to port it
to other systems is on the way. I'm planning to keep this site an
up-to-date mirror of my local machine (which is connected to the
internet over some expensive dialup connection, so I'll upload it about
once every day I made significant changes) so that you can always find
the latest version of the software here.
I've written a simple guile interface for the library to show which
information it can already fetch. See examples/third for details.
Source Code:
LATEST NEWS:
===========
libgtop-current-cvs.cpio.gz is a cpio archive from the CVS repository
libgtop-current.cpio.gz contains the lates checked out sources
libgtop-stable.cpio.gz if present, it contains the last stable release
Documentation:
=============
libgtop.sgml is the SGML source of the (DocBook) documentation
The next three files are only provided until they get too big to upload.
libgtop.tex TEX file of the documentation
libgtop.dvi DVI file of the documentation
libgtop.ps Postscript file of the documentation
HTML-Documentation:
==================
libgtop.shtml Start here to browse the HTML documentation
Other stuff:
===========
README, NEWS, ChangeLog copied from the sources
Enjoy it!
Martin (martin@home-of-linux.org - baulig@merkur.uni-trier.de)
Please look also in the file 'NEWS' for latest news.
Martin

View File

@@ -1,8 +0,0 @@
$Id$
LATEST NEWS:
===========
Please look also in the file 'NEWS' for latest news.
Martin

163
RELNOTES-1.0 Normal file
View File

@@ -0,0 +1,163 @@
RELEASE NOTES FOR LIBGTOP 1.0 STABLE
====================================
OVERVIEW
--------
LibGTop is a library that read information about processes and the
running systems. This information include:
General System Information:
cpu - CPU Usage
mem - Memory Usage
swap - Swap Usage (including paging activity)
loadavg - Load average (including nr_running, nr_tasks, last_pid)
uptime - Uptime and Idle time, can be calculated from CPU usage
SYS V IPC Limits:
shm_limits - Shared Memory Limits
msg_limits - Message Queue Limits
sem_limits - Semaphore Set Limits
Network:
netload - Network load
ppp - PPP statistics
Process List:
proclist - List of processes
Process information:
proc_state - cmd, state, uid, gid
proc_uid - uid,euid,gid,egid,pid,ppid,pgrp
session,tty,tpgid,priority,nice
proc_mem - size,vsize,resident,share,rss,rss_rlim
proc_time - start_time,rtime,utime,stime,cutime,cstime
timeout,it_real_value,frequency
proc_signal - signal,blocked,sigignore,sigcatch
proc_kernel - k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt
kstk_esp,kstk_eip,nwchan,wchan
proc_segment - text_rss,shlib_rss,data_rss,stack_rss,dirty_size
start_code,end_code,start_stack
Process maps:
proc_args - Command line arguments
proc_map - Process map (/proc/<pid>/maps under Linux)
File system usage:
mountlist - List of currently mounted filesystems
fsusage - File system usage
PORTABILITY:
-----------
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.in script the `--without-gnome'
parameter and then use it fully without GNOME in your own applications.
LIBGTOP AND GNOME - PART II:
---------------------------
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.
PLATFORM SPECIFIC NOTES FOR LINUX:
==================================
Under Linux, LibGTop should work without problems and read everything
from /proc.
LibGTop 0.25 also had an experimental kernel interface to read this
information directly from the kernel with a system call - but I have
currently dropped support for this as I am too busy with GNOME
development to keep current with kernel hacking.
PLATFORM SPECIFIC NOTES FOR SOLARIS:
====================================
Since so many people were asking me about this:
LibGTop currently does not have any support for Solaris, and it will
never have until some volunteer writes the code for it. I can't do this
myself since I do not have any machine to test it on.
PLATFORM SPECIFIC NOTES FOR BSD:
=================================
There are a few caveats:
* You need to manually make the `$(prefix)/bin/libgtop_server' SGID to
kmem after installation and mount the /proc file system of FreeBSD
(/proc/<pid>/mem is used within kvm_uread ()).
* To get the filenames of the process maps displayed in GTop, you need
to configure with the `--with-libgtop-inodedb' option (you need GDBM
for this to work).
You have then to create an inode database which is used to look up
filenames. This is done using the `mkinodedb' program which comes
along with libgtop.
See the file src/inodedb/README for details:
The `mkinodedb' program which is build in this directory takes two
command line arguments: the full pathname of the database to be
created and the name of a configuration file consisting of directory
and file names each on a line by itself - see `/etc/ld.so.conf' for
an example.
Putting a directory name in this file means all regular files found
in this directory are included in the database, but it will not
recursively descend into subdirectories (for instance, we want
everything in `/usr/lib' but not every single file in `/usr/lib/sgml').
You can also use filenames to include a single file.
Have fun,
Martin <martin@home-of-linux.org>

46
TODO Normal file
View File

@@ -0,0 +1,46 @@
This is LibGTop 0.99.2,
a feature-freezed version of LibGTop for GNOME 1.0.
You need to use the latest version of LibGTop from CVS for Gnome, it will
no longer work with older releases.
Martin
--------------------------------------------------------------------------
NOTE: LibGTop is already feature-freezed for GNOME 1.0, so only bug fixes
are ok, no API changes !
Sysdeps directory 'linux':
==========================
* Add implementation for `ppp' with modems.
Sysdeps directory 'freebsd':
============================
* FreeBSD 3.0: It works fine on this system, so please make sure not
to break it here.
* FreeBSD 2.2: Make sure it still works here.
* NetBSD/OpenBSD: Support was added on Dec 6, but we need to check
whether all data are valid.
Sysdeps directories 'kernel', 'osf1' and 'sun4':
================================================
* You need to use the `--enable-hacker-mode' parameter to configure
to build this directories.
--------------------------------------------------------------------------
Everything except sysdeps directories:
======================================
* Ready for Gnome 1.0. [ALREADY FEATURE FREEZED]
January 5, 1999
Martin

View File

@@ -1,3 +1,21 @@
/* Define if gethostname () must be declared. */
#undef NEED_DECLARATION_GETHOSTNAME
/* Define if setreuid () must be declared. */
#undef NEED_DECLARATION_SETREUID
/* Define if setregid () must be declared. */
#undef NEED_DECLARATION_SETREGID
/* Define if getpagesize () must be declared. */
#undef NEED_DECLARATION_GETPAGESIZE
/* Define if program_invocation_name must be declared. */
#undef NEED_DECLARATION_PROGRAM_INVOCATION_NAME
@TOP@
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
@@ -103,7 +121,6 @@
#undef HAVE_LIBTIFF
#undef HAVE_LIBZ
#undef HAVE_LIBPNG
#undef GNOME_ENABLE_DEBUG
#undef HAVE_GMP2_INCLUDE_DIR
#undef HAVE_GUILE
@@ -121,7 +138,32 @@
#undef NEED_LIBGTOP
#undef HAVE_LINUX_TABLE
#undef HAVE_LINUX_SYSCTL
#undef HAVE_LIBGTOP_SMP
#undef HAVE_XAUTH
/* Define if your have the I4B package. */
#undef HAVE_I4B
#undef HAVE_I4B_ACCT
/* Define to enable debugging. */
#undef LIBGTOP_ENABLE_DEBUG
#undef LIBGTOP_FATAL_WARNINGS
/* Same as LINUX_VERSION_CODE either from <linux/version.h> or from
* the running kernel (if we don't have configured kernel sources).
*/
#undef GLIBTOP_LINUX_VERSION_CODE
/* Solaris release code (eg. 251 for Solaris 2.5.1). */
#undef GLIBTOP_SOLARIS_RELEASE
/* Define if you want to use LibGTop without GNOME. */
#undef WITHOUT_GNOME
/* Define if you have the <procfs.h> header file */
#undef HAVE_PROCFS_H
/* Define if you have the <sys/procfs.h> header file */
#undef HAVE_SYS_PROCFS_H

View File

@@ -1,400 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.2h
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
dnl This Makefile.in is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
######################################################################
# progtest.m4 from gettext 0.32
######################################################################
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
######################################################################
# lcmessage.m4 from gettext 0.32
######################################################################
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])
######################################################################
# gettext.m4 from gettext 0.32
######################################################################
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 3
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_TRY_LINK([], [return (int) gettext ("")],
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext programs is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])

883
config.guess vendored
View File

@@ -1,883 +0,0 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i?86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo i386-pc-cygwin32
exit 0 ;;
i*:MINGW*:*)
echo i386-pc-mingw32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
objdump --private-headers dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1

954
config.sub vendored
View File

@@ -1,954 +0,0 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 \
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
basic_machine=$basic_machine-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[3456]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigaos | amigados)
basic_machine=m68k-cbm
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[3456]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i[3456]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i[3456]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i[3456]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5)
basic_machine=i586-intel
;;
pentiumpro | p6)
basic_machine=i686-intel
;;
pentium-* | p5-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
k5)
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
basic_machine=i586-amd
;;
nexen)
# We don't have specific support for Nexgen yet, so just call it a Pentium
basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
os=-nextstep2
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f301-fujitsu)
os=-uxpv
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os

View File

@@ -1,21 +1,52 @@
dnl
Mnl Configure script for the Gnome library
dnl Configure script for the Gnome library
dnl
AC_INIT(copyright.txt)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
dnl This is required at several places
AC_CHECK_PROG(ac_dc_found, dc, yes, no)
if test x$ac_dc_found != xyes ; then
AC_MSG_ERROR([
*** The "dc" utility was not found on your system.
***
*** When using RedHat Linux, you need to install the "bc" package.
***
*** It is now part of the "bc" package, so you should look at
*** ftp://ftp.gnu.org/pub/gnu/bc/ if you want to compile it yourself.
***
*** Other systems and distributions may also have it in their "bc" package,
*** so if there's no "dc" one, please look for "bc".
***])
fi
. $srcdir/LIBGTOP-VERSION
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_SUBST(LIBGTOP_MAJOR_VERSION)
AC_SUBST(LIBGTOP_MINOR_VERSION)
AC_SUBST(LIBGTOP_MICRO_VERSION)
AC_SUBST(LIBGTOP_INTERFACE_AGE)
AC_SUBST(LIBGTOP_BINARY_AGE)
AC_SUBST(LIBGTOP_SERVER_VERSION)
AC_SUBST(LIBGTOP_VERSION)
AC_SUBST(LIBGTOP_VERSION_CODE)
AM_ACLOCAL_INCLUDE(macros)
# libtool versioning
LT_RELEASE=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION
LT_CURRENT=`expr $LIBGTOP_MICRO_VERSION - $LIBGTOP_INTERFACE_AGE`
LT_REVISION=$LIBGTOP_INTERFACE_AGE
LT_AGE=`expr $LIBGTOP_BINARY_AGE - $LIBGTOP_INTERFACE_AGE`
LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
AC_SUBST(LT_VERSION_INFO)
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AM_ACLOCAL_INCLUDE(. macros)
AC_ISC_POSIX
AC_PROG_CC
@@ -27,6 +58,10 @@ dnl does not work for libgtop.
AC_CHECK_PROGS(AWK, gawk awk, )
test -z "$AWK" && AC_MSG_ERROR([Sorry, you need a working awk interpreter.])
dnl Most people should have a working perl interpreter on their system
AC_CHECK_PROGS(PERL, perl5 perl)
test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.])
AC_CHECK_TOOL(CC,gcc)
AC_CHECK_TOOL(RANLIB,ranlib)
AC_CHECK_TOOL(AS,as)
@@ -44,10 +79,22 @@ export cross_compiling
AM_PROG_LIBTOOL
dnl If you want to use libgtop without gnome, comment the following line out.
dnl Let the user enable compiler warnings
GNOME_COMPILE_WARNINGS
GNOME_INIT_HOOK(gnome_found=yes)
if test "x$gnome_found" != xyes; then
if test "x$want_gnome" != xno ; then
AC_MSG_ERROR([
*** GNOME was not found on this system. ***
*** If you want to use LibGTop without GNOME, you need
*** to give configure the --without-gnome parameter.
])
else
AC_DEFINE(WITHOUT_GNOME)
fi
GNOME_SUPPORT_CHECKS
else
AM_CONDITIONAL(BUILD_GNOME_SUPPORT, false)
@@ -57,13 +104,13 @@ fi
GNOME_LIBGTOP_SYSDEPS
GNOME_LIBGTOP_TYPES
GNOME_CHECK_GUILE
AC_ARG_WITH(libgtop-guile,
[ --with-libgtop-guile Build the libgtop guile interface (default=yes)],
[ --with-libgtop-guile Build the libgtop guile interface (default=no)],
[build_guile="$withval"], [build_guile=yes])
test x$build_guile = xno && ac_cv_guile_found=no
if test x$build_guile != xno ; then
GNOME_CHECK_GUILE
fi
AC_ARG_WITH(libgtop-inodedb,
[ --with-libgtop-inodedb Build the inodedb stuff (default=no)],
@@ -87,20 +134,41 @@ if test x$ac_cv_guile_found = xyes ; then
AC_DEFINE(GLIBTOP_GUILE)
AC_DEFINE(GLIBTOP_GUILE_NAMES)
libgtop_guile_found=yes
guile_examples='third third_static'
guile_examples='third'
guile_static_examples='third_static'
guile_subdirs='guile'
else
libgtop_guile_found=no
guile_examples=
guile_static_examples=
guile_subdirs=
fi
if test x$libgtop_smp = xyes ; then
smp_examples='smp'
smp_static_examples='smp_static'
else
smp_examples=
smp_static_examples=
fi
if test "x$enable_static" != xno; then
static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $guile_static_examples $smp_static_examples"
else
static_targets=""
fi
AC_SUBST(static_targets)
AC_SUBST(smp_examples)
AC_SUBST(guile_examples)
AC_SUBST(guile_subdirs)
AM_PROG_LIBTOOL
dnl You need to uncomment the following line if you want to use libgtop without Gnome.
AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GLIB >= 1.2.0 is required for LibGTop))
dnl You need to uncomment the following line if you want to use
dnl libGTop without Gnome.
dnl GNOME_SUPPORT_CHECKS
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -121,9 +189,25 @@ AC_CHECK_HEADERS(string.h strings.h, break)
AC_REPLACE_FUNCS(strerror)
AC_CHECK_LIB(kvm, kvm_open)
dnl Solaris
AC_CHECK_LIB(kstat, kstat_open)
AC_CHECK_FUNCS(getloadavg swapctl)
AC_CHECK_HEADERS(procfs.h sys/procfs.h, break)
dnl For DEC OSF1
AC_CHECK_LIB(mach, vm_statistics)
dnl For some broken libc5 systems (Debian 1.3)
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -D_GNU_SOURCE"
GCC_NEED_DECLARATION(program_invocation_name, [
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
])
CFLAGS=$saved_CFLAGS
dnl Check for Internet sockets.
AC_CHECK_FUNC(socket,
[AC_CHECK_HEADER(netinet/in.h,
@@ -146,11 +230,18 @@ AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
ALL_LINGUAS="fr"
AM_GNU_GETTEXT
dnl ## all 'es_??' are only needed for format numbers different of 'es'
ALL_LINGUAS="de es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fi fr ko no ja"
AM_GNOME_GETTEXT
AC_PATH_XTRA
dnl For Solaris
dnl Please don't move this before AC_PATH_XTRA
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
dnl So we use the following instead.
dnl XE_SPACE(var, words)
@@ -162,7 +253,8 @@ $1="$T"
dnl Autodetect Xauth
dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs
test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) }
test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no, $X_LIBS) }
test -z "$with_xauth" && with_xauth=yes
@@ -170,40 +262,56 @@ if test "$with_xauth" = "yes"; then
AC_DEFINE(HAVE_XAUTH)
XE_SPACE(libs_xauth, $X_LIBS -lXau)
fi
CPPFLAGS="$saved_CPPFLAGS"
AC_SUBST(libs_xauth)
dnl For diskusage stuff
GNOME_FILEUTILS_CHECKS
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
dnl Debugging
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(LIBGTOP_ENABLE_DEBUG),)
AC_ARG_ENABLE(fatal-warnings, [ --enable-fatal-warnings make all warnings fatal [debug=no]],AC_DEFINE(LIBGTOP_FATAL_WARNINGS),)
dnl If you want to use libgtop without gnome, uncomment the following paragraph:
dnl LIBSUPPORT=
dnl SUPPORTINCS=
dnl if test "$need_gnome_support" = yes; then
dnl LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
dnl SUPPORTINCS='-I$(top_srcdir)/support'
dnl fi
dnl AC_SUBST(LIBSUPPORT)
dnl AC_SUBST(SUPPORTINCS)
dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS, we include it here.
echo "$GNOME_LIBS" | grep -q -e '-lgnomesupport'
if test $? = 0 ; then
if test "x$gnome_found" = xyes ; then
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
SUPPORTINCS="$GNOME_INCLUDEDIR"
else
LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
fi
dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS,
dnl we include it here.
case "$GNOME_LIBS" in
'*-lgnomesupport*' )
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
SUPPORTINCS="$GNOME_INCLUDEDIR" ;;
esac
AC_SUBST(LIBSUPPORT)
AC_SUBST(SUPPORTINCS)
dnl These definitions are expanded in make.
LIBGTOP_LIBS='-L$(libdir) -lgtop'
LIBGTOP_INCS='-I$(includedir)'
LIBGTOP_LIBS='-L$(libdir)'
LIBGTOP_INCS='-I$(includedir) -I$(pkglibdir)/include'
if test x$libgtop_use_machine_h = xyes ; then
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_GLIBTOP_MACHINE_H"
fi
if test x$build_inodedb = xyes ; then
LIBGTOP_INCS="$LIBGTOP_INCS -DGLIBTOP_INODEDB"
fi
if test x$libgtop_smp = xyes ; then
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SMP"
fi
if test x$libgtop_have_sysinfo = xyes ; then
LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO"
fi
LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS $GLIB_CFLAGS"
LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS"
LIBGTOP_BINDIR='$(bindir)'
@@ -221,18 +329,19 @@ fi
AC_SUBST(libgtop_guile_found)
if test -z $LIBGTOP_EXTRA_LIBS ; then
if test -z "$LIBGTOP_EXTRA_LIBS" ; then
LIBGTOP_EXTRA_LIBS="$libs_xauth"
else
LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $libs_xauth"
fi
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common -lgtop_sysdeps"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common -lgtop_sysdeps"
LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $GLIB_LIBS"
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop -lgtop_sysdeps -lgtop_common"
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop -lgtop_sysdeps -lgtop_common"
LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS -lgtop_names"
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names"
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_names"
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names -lgtop_names"
LIBGTOP_LIBS="$LIBGTOP_LIBS"
LIBGTOP_NAMES_LIBS="$LIBGTOP_NAMES_LIBS"
@@ -256,7 +365,7 @@ else
guile_def=""
fi
INCLUDES="$CFLAGS -D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES $guile_def -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $SUPPORTINCS $GLIB_CFLAGS $CFLAGS $X_CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_VERSION_CODE='$LIBGTOP_VERSION_CODE' -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
AC_SUBST(INCLUDES)
@@ -273,18 +382,6 @@ AC_SUBST(LIBGTOP_GUILE_NAMES_INCS)
AC_SUBST(LIBGTOP_BINDIR)
AC_SUBST(LIBGTOP_SERVER)
LIBSUPPORT=
SUPPORTINCS=
if test "$need_gnome_support" = yes; then
if test "x$gnome_found" = xyes ; then
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
SUPPORTINCS="$GNOME_INCLUDEDIR"
else
LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
fi
fi
if test x$libgtop_need_server = xyes ; then
sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid.la"
server_programs='libgtop_server'
@@ -295,10 +392,145 @@ fi
AC_SUBST(sysdeps_suid_lib)
AC_SUBST(server_programs)
dnl The following one is copied from glib/configure.in
AC_OUTPUT_COMMANDS([
## Generate `glibconfig.h' in two cases
## 1. `config.status' is run either explicitly, or via configure.
## Esp. not when it is run in `Makefile' to generate makefiles and
## config.h
## 2. CONFIG_OTHER is set explicitly
##
## Case 1 is difficult. We know that `automake' sets one of
## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
## only when AM_CONFIG_HEADER is set, however.
if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
# Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
CONFIG_OTHER=${CONFIG_OTHER:-glibtop-config.h}
fi
case "$CONFIG_OTHER" in
*glibtop-config.h*)
echo creating glibtop-config.h
outfile=glibtop-config.h-tmp
cat > $outfile <<\_______EOF
/* glibtop-config.h
*
* This is a generated file. Please modify `configure.in'
*/
#ifndef GLIBTOP_CONFIG_H
#define GLIBTOP_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
_______EOF
did_typedefs=no
if test x$glibtop_uint64_t != xyes ; then
did_typedefs=yes
cat >> $outfile <<\_______EOF
#ifndef u_int64_t
typedef u_int64_t unsigned long long int
#endif
_______EOF
fi
if test x$glibtop_int64_t != xyes ; then
did_typedefs=yes
cat >> $outfile <<\_______EOF
#ifndef int64_t
typedef int64_t signed long long int
#endif
_______EOF
fi
if test x$did_typedefs = xyes ; then
cat >>$outfile <<_______EOF
/*
* NOTE: If your application checks for "u_int64_t" or "int64_t" in its own
* config.h, you must not include it after any of the LibGTop headers.
*/
_______EOF
fi
cat >>$outfile <<_______EOF
/* Define if we need the LibGTop server. */
_______EOF
if test x$glibtop_need_libgtop = xyes ; then
echo '#define NEED_LIBGTOP 1' >> $outfile
else
echo '#undef NEED_LIBGTOP' >> $outfile
fi
cat >>$outfile <<_______EOF
/* Define if LibGTop has support for multiple processors. */
_______EOF
if test x$glibtop_have_smp = xyes ; then
echo '#define HAVE_LIBGTOP_SMP 1' >> $outfile
else
echo '#undef HAVE_LIBGTOP_SMP' >> $outfile
fi
cat >>$outfile <<_______EOF
/* LibGTop major, minor and micro version. */
#define LIBGTOP_MAJOR_VERSION $libgtop_major_version
#define LIBGTOP_MINOR_VERSION $libgtop_minor_version
#define LIBGTOP_MICRO_VERSION $libgtop_micro_version
/* LibGTop version and numerical version code ("1.234.567" -> 1234567). */
#define LIBGTOP_VERSION "$libgtop_version"
#define LIBGTOP_VERSION_CODE $libgtop_version_code
/* LibGTop server version, increased each time the protocol changes. */
#define LIBGTOP_SERVER_VERSION $libgtop_server_version
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GLIBCONFIG_H */
_______EOF
if cmp -s $outfile glibtop-config.h; then
echo glibtop-config.h is unchanged
rm -f $outfile
else
mv $outfile glibtop-config.h
fi ;;
esac
],[
glibtop_uint64_t=$ac_cv_type_u_int64_t
glibtop_int64_t=$ac_cv_type_int64_t
libgtop_major_version=$LIBGTOP_MAJOR_VERSION
libgtop_minor_version=$LIBGTOP_MINOR_VERSION
libgtop_micro_version=$LIBGTOP_MICRO_VERSION
libgtop_version_code=$LIBGTOP_VERSION_CODE
libgtop_server_version=$LIBGTOP_SERVER_VERSION
libgtop_version=$LIBGTOP_VERSION
glibtop_need_libgtop=$libgtop_need_server
glibtop_have_smp=$libgtop_smp
])
AC_OUTPUT([
Makefile
libgtop.spec
po/Makefile.in
intl/Makefile
misc/Makefile
include/Makefile
include/glibtop/Makefile
sysdeps/Makefile
@@ -313,12 +545,12 @@ sysdeps/osf1/Makefile
sysdeps/linux/Makefile
sysdeps/kernel/Makefile
sysdeps/freebsd/Makefile
sysdeps/solaris/Makefile
src/Makefile
src/daemon/Makefile
src/inodedb/Makefile
lib/Makefile
guile/Makefile
examples/Makefile
perl/Makefile.PL
doc/Makefile
support/Makefile
macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
macros/Makefile])

View File

@@ -1,21 +1,23 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/

View File

@@ -1,10 +1,10 @@
*.shml
*.ced
.timestamp
.timestamp2
.timestamp3
.timestamp4
gnome-hackers
libgtop
libgtop-ref
table
texinfo.tex
*.info
Makefile.in
Makefile
*.log *.toc *.dvi *.aux *.cp *.fn *.vr *.tp *.ky *.pg
*.ps
auto-macros.texi
version.texi
stamp-vti
*.html *.pdf

View File

@@ -1,18 +1,33 @@
1998-08-12 Martin Baulig <martin@home-of-linux.org>
1999-05-28 Martin Baulig <baulig@Stud.Informatik.Uni-Trier.DE>
* features: New directory.
* gnome-hackers.sgml: Updated documentation.
* internals.texi: New file documenting LibGTop internals.
* reference.texi: Started to document all library functions and
finished the sysdeps and common references.
1998-08-11 Martin Baulig <martin@home-of-linux.org>
1999-05-16 Martin Baulig <martin@home-of-linux.org>
* gnome-hackers.sgml: Updated documentation.
* autoconf.sgml: New file, included from `gnome-hackers.sgml'.
* main.texi: This is now the main file which will @include all
chapter files so we can use `texinfo-multiple-files-update'.
1998-07-21 Martin Baulig <martin@home-of-linux.org>
* reference.texi: Added all missing sections with a "not yet written"
notice.
* gnome-hackers.sgml: Added note that this file is
currently out of date and a link to the documentation
of the table () function.
1999-05-16 Martin Baulig <martin@home-of-linux.org>
* white-paper.texi: Initial version of the LibGTop White Paper.
* Makefile.am: Create `auto-macros.texi' from `auto-macros.texi.in'
which will contain some `@set' commands for the LibGTop version etc.
* auto-macros.texi.in: New file. This is a template for
`auto-macros.texi' which will be automatically generated.
1999-05-09 Martin Baulig <martin@home-of-linux.org>
* about.texi: Split the `libgtop.texi' into one file pro chapter,
this is the "About LibGTop".
* reference.texi: The "LibGTop Reference Manual".
* libgtop.texi: Initial version of the new LibGTop Manual.
* table.sgml: New file - basic documentation for the
table () system call.

View File

@@ -1,39 +0,0 @@
all: .timestamp .timestamp2 .timestamp3 .timestamp4
clean:
-rm -f .timestamp*
-rm -rf libgtop gnome-hackers libgtop-ref table
.timestamp: libgtop.sgml
-rm -rf libgtop
mkdir libgtop
-rm -f .timestamp
jade -D /usr/lib/sgml -d libgtop.dsl -t sgml \
-V %no-make-index% libgtop.sgml > /dev/null && \
touch .timestamp
.timestamp2: gnome-hackers.sgml autoconf.sgml ../guile/reference.sgml \
features/uptime.sgml features/uptime.txt features/proclist.sgml \
features/procmem.sgml
-rm -rf gnome-hackers
mkdir gnome-hackers
-rm -f .timestamp2
jade -D /usr/lib/sgml -d gnome-hackers.dsl -t sgml \
-V %no-make-index% gnome-hackers.sgml > /dev/null && \
touch .timestamp2
.timestamp3: libgtop-ref.sgml ../guile/reference.sgml
-rm -rf libgtop-ref
mkdir libgtop-ref
-rm -f .timestamp3
jade -D /usr/lib/sgml -d libgtop-ref.dsl -t sgml \
-V %no-make-index% libgtop-ref.sgml > /dev/null && \
touch .timestamp3
.timestamp4: table.sgml
-rm -rf table
mkdir table
-rm -f .timestamp4
jade -D /usr/lib/sgml -d table.dsl -t sgml \
-V %no-make-index% table.sgml > /dev/null && \
touch .timestamp4

43
doc/Makefile.am Normal file
View File

@@ -0,0 +1,43 @@
info_TEXINFOS = libgtop.texi
libgtop_TEXINFOS = libgtop.texi about.texi reference.texi \
auto-macros.texi version.texi main.texi \
white-paper.texi internals.texi
EXTRA_DIST = auto-macros.texi.in
auto-macros.texi: auto-macros.texi.in Makefile
## Use sed and then mv to avoid problems if the user interrupts.
sed -e 's#\%LIBGTOP_LIBDIR\%#$(libdir)#g' \
-e 's#\%LIBGTOP_INCLUDEDIR\%#$(includedir)#g' \
-e 's#\%LIBGTOP_DATADIR\%#$(datadir)#g' \
-e 's#\%LIBGTOP_EXTRA_LIBS\%#$(LIBGTOP_EXTRA_LIBS)#g' \
-e 's#\%LIBGTOP_LIBS\%#$(LIBGTOP_LIBS)#g' \
-e 's#\%LIBGTOP_INCS\%#$(LIBGTOP_INCS)#g' \
-e 's#\%LIBGTOP_NAMES_LIBS\%#$(LIBGTOP_NAMES_LIBS)#g' \
-e 's#\%LIBGTOP_NAMES_INCS\%#$(LIBGTOP_NAMES_INCS)#g' \
-e 's#\%LIBGTOP_GUILE_LIBS\%#$(LIBGTOP_GUILE_LIBS)#g' \
-e 's#\%LIBGTOP_GUILE_INCS\%#$(LIBGTOP_GUILE_INCS)#g' \
-e 's#\%LIBGTOP_GUILE_NAMES_LIBS\%#$(LIBGTOP_GUILE_NAMES_LIBS)#g' \
-e 's#\%LIBGTOP_GUILE_NAMES_INCS\%#$(LIBGTOP_GUILE_NAMES_INCS)#g' \
-e 's#\%LIBGTOP_BINDIR\%#$(LIBGTOP_BINDIR)#g' \
-e 's#\%LIBGTOP_SERVER\%#$(LIBGTOP_SERVER)#g' \
-e 's#\%LIBGTOP_MAJOR_VERSION\%#$(LIBGTOP_MAJOR_VERSION)#g' \
-e 's#\%LIBGTOP_MINOR_VERSION\%#$(LIBGTOP_MINOR_VERSION)#g' \
-e 's#\%LIBGTOP_MICRO_VERSION\%#$(LIBGTOP_MICRO_VERSION)#g' \
-e 's#\%LIBGTOP_VERSION\%#$(LIBGTOP_VERSION)#g' \
-e 's#\%LIBGTOP_VERSION_CODE\%#$(LIBGTOP_VERSION_CODE)#g' \
-e 's#\%LIBGTOP_SERVER_VERSION\%#$(LIBGTOP_SERVER_VERSION)#g' \
-e 's#\%libgtop_sysdeps_dir\%#$(libgtop_sysdeps_dir)#g' \
-e 's#\%libgtop_need_server\%#$(libgtop_need_server)#g' \
-e 's#\%libgtop_use_machine_h\%#$(libgtop_use_machine_h)#g' \
-e 's#\%libgtop_guile_found\%#$(libgtop_guile_found)#g' \
-e 's#\%libgtop_want_examples\%#$(libgtop_want_examples)#g' \
< $(srcdir)/auto-macros.texi.in > auto-macros.tmp
echo '@c Set this if this is LibGTop 1.1.x' >> auto-macros.tmp
if [ $(LIBGTOP_VERSION_CODE) -ge 1001000 ] ; then \
echo '@set LIBGTOP-1-1' >> auto-macros.tmp ; \
else \
echo '@clear LIBGTOP-1-1' >> auto-macros.tmp ; \
fi
mv auto-macros.tmp auto-macros.texi

9
doc/README Normal file
View File

@@ -0,0 +1,9 @@
This directory is shared between the HEAD and the LIBGTOP_STABLE_1_0
branch (`LIBGTOP_STABLE_1_0' is just an ordinary tag and no branch tag
here).
Whenever we make a new release of LibGTop 1.0.x, we'll move that tag to
point to a "stable" version of the documentation.
May 16, 1999
Martin Baulig

114
doc/about.texi Normal file
View File

@@ -0,0 +1,114 @@
@node About, White Paper, Top, Top
@chapter About LibGTop
LibGTop is a library to get system specific data such as CPU and Memory Usage
and information about running Processes.
On Systems like Solaris or Digital Unix where you need special privileges to
get those data, it uses a setuid/setgid server to do so.
@menu
* Availability:: Where to get LibGTop
* Supported Platforms:: Supported Platforms
* Mailing List:: Helping with LibGTop development
* Thanks:: People who contributed to LibGTop
@end menu
@node Availability, Supported Platforms, About, About
@section Availability
The master source of LibGTop is the GNOME CVS tree
(see @uref{http://www.gnome.org} for details), but you can also get the
latest release tarballs from
@display
@uref{ftp://ftp.gnome.org/pub/GNOME/sources/libgtop/}
@end display
@noindent
or any of its mirror sites.
The latest stable version of LibGTop is 1.0.1 which is also the one that comes
together with GNOME 1.0. In CVS, there is a @code{LIBGTOP_STABLE_1_0} branch
which is rooted at the @code{LIBGTOP_1_0_1} tag while actual development occurs
in the @code{HEAD} which currently has version 1.1.0.
@node Supported Platforms, Mailing List, Availability, About
@section Supported Platforms
The stable branch currently supports the following platforms:
@itemize @bullet
@item All versions of Linux
LibGTop was tested under Linux 2.0.x and 2.2.x on the ix86 and the alpha, but
it should also work without problems on SparcLinux.
@item FreeBSD, NetBSD and OpenBSD
LibGTop was tested under FreeBSD 2.2.6 and 3.0, NetBSD 1.3.2 and OpenBSD 2.4.
Support for NetBSD 1.4 was added in LibGTop 1.0.2.
@end itemize
The platforms listed above are known to be stable and working. However, if
you're using the latest development version, you can use it on the following
platforms as well:
@itemize @bullet
@item BSD/OS
There is a port for BSD/OS (aka BSDI) 2.x and 3.x from Timur Bakeyev which
should also work with 4.x. This isn't tested very well, but it should be
working.
@item Digital Unix
There is some basic support for Digital Unix (formerly DEC OSF/1) V3.2C, but
this may still be a bit unstable. I'm currently working on this port as time
permits so it should be fully supported soon.
@item Solaris
There will be a Solaris port of LibGTop very soon. Especially Drazen Kacar and
some other people have been doing excellent work here and I'm sure that this
port will be ready soon.
@end itemize
@node Mailing List, Thanks, Supported Platforms, About
@section Mailing List
There is a @email{libgtop-devel-list@@egroups.com} mailing list for people who
want to help with the development of LibGTop.
It is meant as a low-traffic, but high content-list where we can discuss
technical details such as adding new sysdeps ports etc.
Especially, I'd like to see people with a deeper knowledge of operating systems
internals joining my list so we can discuss technical details of the sysdeps
code.
It is *not* for users that want to know how to compile LibGTop etc.
You can subscribe to this mailing list and view the mailing list archives
on the LibGTop Page at @uref{http://www.home-of-linux.org/gnome/libgtop}.
@node Thanks, , Mailing List, About
@section Thanks
At the place I'd like to thank the following people who contributed to
LibGTop (listed in chronological order):
@itemize @bullet
@item Sebastian Wilhelmi who had the initial idea of LibGTop and helped
me a lot in the early beginning.
@item Josh Sled for the initial FreeBSD port.
@item Jeremy Lea for his BSD patches.
@item Timur Bakeyev for the BSDI port.
@item Drazen Kacar and the other people on the LibGTop development mailing
list for the Solaris port.
@item All people sending me patches, having good ideas, ...
@item Everyone I have forgotten in this list ...
@end itemize

12
doc/auto-macros.texi.in Normal file
View File

@@ -0,0 +1,12 @@
@c LibGTop major, minor and micro version.
@set LIBGTOP_MAJOR_VERSION %LIBGTOP_MAJOR_VERSION%
@set LIBGTOP_MINOR_VERSION %LIBGTOP_MINOR_VERSION%
@set LIBGTOP_MICRO_VERSION %LIBGTOP_MICRO_VERSION%
@c LibGTop version and numerical version code ("1.234.567" -> 1234567).
@set LIBGTOP_VERSION "%LIBGTOP_VERSION%"
@set LIBGTOP_VERSION_CODE %LIBGTOP_VERSION_CODE%
@c LibGTop server version, increased each time the protocol changes.
@set LIBGTOP_SERVER_VERSION %LIBGTOP_SERVER_VERSION%

View File

@@ -1,253 +0,0 @@
<sect1 id="macros">
<title>Autoconf macros</title>
<para>
All you need to check for &libgtop; is in &gnome-libgtop-check.m4;,
just use <function>GNOME_INIT_LIBGTOP</function> with an optional
<parameter>fail</parameter> argument in the same way like
<function>GNOME_INIT</function>:
<example>
<title>Warn if &libgtop; cannot be found</title>
<programlisting>GNOME_INIT_LIBGTOP</programlisting>
</example>
<example>
<title>Abort if &libgtop; cannot be found</title>
<programlisting>GNOME_INIT_LIBGTOP(fail)</programlisting>
</example>
<para>
This will define a <function>HAVE_LIBGTOP</function> automake
conditional and everything from the configuration script of
&libgtop;.
<sect1 id="libgtopConf.sh">
<title>The configuration script of &libgtop; (&libgtopConf.sh;)</title>
<para>
After a successful build of &libgtop;, a &libgtopConf.sh; script
containing useful configuration variables is created.
<para>
It defines the following variables which you can use in your
<filename>Makefile.am</filename>:
<variablelist>
<varlistentry>
<term><parameter>LIBGTOP_LIBDIR</parameter></term>
<listitem>
<para>
The directory where the library files of &libgtop; are installed.
<varlistentry>
<term><parameter>LIBGTOP_INCLUDEDIR</parameter></term>
<listitem>
<para>
The directory where the header files of &libgtop; are installed.
<varlistentry>
<term><parameter>LIBGTOP_LIBS</parameter></term>
<listitem>
<para>
Use this to link your program with &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_INCS</parameter></term>
<listitem>
<para>
Use this to get the header files for &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_NAMES_LIBS</parameter></term>
<listitem>
<para>
Use this to link your program with &libgtop; and its
names interface.
<varlistentry>
<term><parameter>LIBGTOP_NAMES_INCS</parameter></term>
<listitem>
<para>
Use this to get the header files for &libgtop; and the
required <literal>-DGLIBTOP_NAMES</literal> to get its
names interface.
<varlistentry>
<term><parameter>LIBGTOP_GUILE_LIBS</parameter></term>
<listitem>
<para>
Use this to link your program with &libgtop; and its
guile interface. This will also include all the required
guile libraries.
<varlistentry>
<term><parameter>LIBGTOP_GUILE_INCS</parameter></term>
<listitem>
<para>
Use this to get the header files for &libgtop; and guile
and the required <literal>-DGLIBTOP_GUILE</literal> to get
the guile interface of &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_GUILE_NAMES_LIBS</parameter></term>
<listitem>
<para>
Use this to link your program with &libgtop; and both its
names and its guile interface. This will also include all the
required guile libraries.
<varlistentry>
<term><parameter>LIBGTOP_GUILE_NAMES_INCS</parameter></term>
<listitem>
<para>
Use this to get the header files for &libgtop;, its guile
and its names interface, the guile header files and the
required <literal>-DGLIBTOP_GUILE</literal> and
<literal>-DGLIBTOP_NAMES</literal>.
<varlistentry>
<term><parameter>LIBGTOP_BINDIR</parameter></term>
<listitem>
<para>
The directory where the binaries of &libgtop; are installed.
<varlistentry>
<term><parameter>LIBGTOP_SERVER</parameter></term>
<listitem>
<para>
Full pathname of the &libgtop; server.
<varlistentry>
<term><parameter>LIBGTOP_MAJOR_VERSION</parameter></term>
<listitem>
<para>
Major version of &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_MINOR_VERSION</parameter></term>
<listitem>
<para>
Minor version of &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_VERSION</parameter></term>
<listitem>
<para>
Full version of &libgtop;.
<varlistentry>
<term><parameter>LIBGTOP_SERVER_VERSION</parameter></term>
<listitem>
<para>
Version of the &libgtop; server. This is incremented each
time the client/server protocol changes.
<varlistentry>
<term><parameter>libgtop_sysdeps_dir</parameter></term>
<listitem>
<para>
The sysdeps directory that is used on your system.
<varlistentry>
<term><parameter>libgtop_need_server</parameter></term>
<listitem>
<para>
Either <literal>yes</literal> or <literal>no</literal>.
<varlistentry>
<term><parameter>libgtop_use_machine_h</parameter></term>
<listitem>
<para>
Either <literal>yes</literal> or <literal>no</literal>.
Intended for <emphasis>internal use only</emphasis>
and may be removed in future versions.
<note>
<title>Note for &libgtop; hackers</title>
<para>
This variable gets set in
<filename>macros/gnome-libgtop-sysdeps.m4</filename>.
<para>
If this is enabled, you need to put a
<filename>glibtop_machine.h</filename> header file in the
sysdeps directory which needs to define a structure of
type <type>glibtop_machine</type>.
<para>
This structure represents the
<structfield>machine</structfield> field of
<type>glibtop</type> defined in
<filename>glibtop.h</filename>
and can be used to store some
machine dependent data.
</note>
<varlistentry>
<term><parameter>libgtop_guile_found</parameter></term>
<listitem>
<para>
Either <literal>yes</literal> or <literal>no</literal>.
<varlistentry>
<term><parameter>libgtop_want_examples</parameter></term>
<listitem>
<para>
Considered obsolete.
</variablelist>
<para>
All this variables are taken from the
&libgtopConf.sh; script which is created during
the installation of &libgtop;.
<example>
<title>
Sample &libgtopConf.sh; (gnome and guile are installed in
<filename>/home/baulig/INSTALL</filename> and &libgtop; in
<filename>/home/norwegen/TEST</filename>)
</title>
<programlisting>&example-libgtopConf-sh;</programlisting>
</example>
</sect1>
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
sgml-parent-document: ("gnome-hackers.sgml" "book" "chapter" "")
End:
-->

View File

@@ -1,3 +0,0 @@
PUBLIC "-//James Clark//DTD DSSSL Flow Object Tree//EN" "fot.dtd"
PUBLIC "ISO/IEC 10179:1996//DTD DSSSL Architecture//EN" "dsssl.dtd"
PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" "style-sheet.dtd"

File diff suppressed because it is too large Load Diff

View File

@@ -1,153 +0,0 @@
<para>
This functions takes the following additional parameters:
<variablelist>
<varlistentry>
<term><parameter>which</parameter></term>
<listitem>
<para>
You can use the following constants (defined in
<filename>glibtop/proclist.h</filename>) to tell
<function>glibtop_get_proclist ()</function> which processes
to fetch:
<variablelist>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_ALL</parameter></term>
<listitem>
<para>
Fetch all processes.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_PID</parameter></term>
<listitem>
<para>
Fetch process with pid <parameter>arg</parameter> or
nothing if no such process exists.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_PGRP</parameter></term>
<listitem>
<para>
Fetch only processes which are in process group
<parameter>arg</parameter>.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_SESSION</parameter></term>
<listitem>
<para>
Fetch only processes with session id
<parameter>arg</parameter>.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_TTY</parameter></term>
<listitem>
<para>
Fetch only processes with tty id
<parameter>arg</parameter>.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_UID</parameter></term>
<listitem>
<para>
Fetch only processes with effective user id
<parameter>arg</parameter>.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_KERN_PROC_RUID</parameter></term>
<listitem>
<para>
Fetch only processes with real user id
<parameter>arg</parameter>.
</varlistentry>
</variablelist>
<para>
You can use one or more of the following flags (with a
logical or) to hide some processes:
<variablelist>
<varlistentry>
<term><parameter>GLIBTOP_EXCLUDE_IDLE</parameter></term>
<listitem>
<para>
Don't fetch idle processes.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_EXCLUDE_SYSTEM</parameter></term>
<listitem>
<para>
Don't fetch system processes.
</varlistentry>
<varlistentry>
<term><parameter>GLIBTOP_EXCLUDE_NOTTY</parameter></term>
<listitem>
<para>
Don't fetch processes that have no controlling tty.
</varlistentry>
</variablelist>
</varlistentry>
<varlistentry>
<term><parameter>arg</parameter></term>
<listitem>
<para>
Additional argument depending upon the
<parameter>which</parameter> argument.
</varlistentry>
</variablelist>
<para>
This function returns a pointer (of type <type>unsigned *</type>) to
the list of process ids.
<para>
You have to manually &glibtop-free; this pointer once finished with it.
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
sgml-parent-document: ("../gnome-hackers.sgml" "book" "sect1" "")
End:
-->

View File

@@ -1,103 +0,0 @@
<para>
The automatically generated description above is taken from the
manual page of the <filename>/proc</filename> filesystem under Linux
and is a little bit confusing, so I make this clear here.
<note>
<title>Note for people porting &libgtop; to other systems</title>
<para>
Well, every operating system has its own idea about the memory usage
of a processes, and also system utilities like <filename>ps</filename>
show different things on different systems.
<para>
Nevertheless, we should try to make &libgtop; as system independent
as possible, so I give you some hints here how &glibtop-get-procmem;
should work.
<itemizedlist>
<listitem>
<para>
When you use &mmap; with either &MAP-SHARED; or &MAP-PRIVATE;,
this should only affect the &pmem-vsize; of the process and
none of its &pmem-size;, &pmem-resident;, &pmem-shared; and
&pmem-rss; sizes.
<listitem>
<para>
As soon as you read some of the &mmap;ed pages, they will be
demand-loaded and thus count towards the &pmem-size; of the
process. Also - we assume there is enough free memory - they
are resident in memory until they get stolen or swapped out
and thus increase the &pmem-resident; and &pmem-rss; sizes of
the process.
<listitem>
<para>
If the process has used &MAP-SHARED; and another process
attaches the same file also &MAP-SHARED; some of the pages
are shared with this process and thus increase the &pmem-shared;
sizes of both processes.
<listitem>
<para>
If the process has used &MAP-PRIVATE; and writes to the &mmap;ed
pages, the only difference to reading from them is that they
get dirty and cannot be stolen any longer but will get swapped
out.
<listitem>
<para>
If memory gets rare, clean pages are normally stolen which
decreases the &pmem-size;, &pmem-resident;, &pmem-shared; and
&pmem-rss; sizes of the process.
<listitem>
<para>
When dirty pages are swapped out, this will
<emphasis>not</emphasis> decrease the &pmem-size; of the
process but only its &pmem-resident; and &pmem-rss; sizes
(dirty pages cannot be shared).
<listitem>
<para>
The &pmem-vsize; of a process can <emphasis>only</emphasis>
be changed by the process itself when it requests or frees
memory but <emphasis>never</emphasis> due to swapping
activity of the system.
<listitem>
<para>
If the &pmem-shared; size changes, this
<emphasis>only</emphasis> means that the number of pages that
are currently shared with other processes has changed; if this
happens, this will <emphasis>never</emphasis> affect any of the
other sizes of the process.
</itemizedlist>
</note>
<para>
The hints above describe how it works under Linux - and we should try to
make &glibtop-get-procmem; show the same behavior under every other
system.
<para>
If you want to make any comments, flames, suggestions about this, please
feel free to do so.
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
sgml-parent-document: ("../gnome-hackers.sgml" "book" "sect1" "")
End:
-->

View File

@@ -1,23 +0,0 @@
<note>
<para>
You can calculate this from the CPU usage (this one is taken
from the FreeBSD port):
<programlisting>&include-uptime.txt;</programlisting>
</note>
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
sgml-parent-document: ("../gnome-hackers.sgml" "book" "sect1" "")
End:
-->

View File

@@ -1,40 +0,0 @@
#include &lt;glibtop.h&gt;
#include &lt;glibtop/error.h&gt;
#include &lt;glibtop/uptime.h&gt;
#include &lt;glibtop/cpu.h&gt;
#include &lt;glibtop_suid.h&gt;
static const unsigned long _glibtop_sysdeps_uptime =
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME);
static const unsigned long _required_cpu_flags =
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_IDLE) +
(1 << GLIBTOP_CPU_FREQUENCY);
void
glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
{
glibtop_cpu cpu;
glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0);
memset (buf, 0, sizeof (glibtop_uptime));
/* We simply calculate it from the CPU usage. */
glibtop_get_cpu_p (server, &amp;cpu);
/* Make sure all required fields are present. */
if ((cpu.flags &amp; _required_cpu_flags) != _required_cpu_flags)
return;
/* Calculate values. */
buf->uptime = (double) cpu.total / (double) cpu.frequency;
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
buf->flags = _glibtop_sysdeps_uptime;
}

View File

@@ -1,12 +0,0 @@
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
]>
<style-specification id="gnomehackersdbotohtml" use="dbtohtml">
(define %output-basename% "gnome-hackers")
(define %output-directory% "gnome-hackers")
</style-specification>
<external-specification id="dbtohtml" document="dbtohtml.dsl">

View File

@@ -1,187 +0,0 @@
<!-- $Id$ -->
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
<!-- Site-specific entities, change them if you want to copy this
document somewhere else. -->
<!entity home-of-linux "http://www.home-of-linux.org/">
<!-- Some general entities -->
<!entity libgtop "<productname>libgtop</productname>">
<!-- Some abbreviations for often used filenames and functions. -->
<!entity gnome-libgtop-check.m4 "<filename>macros/gnome-libgtop-check.m4</filename>">
<!entity libgtopConf.sh "<filename>libgtopConf.sh</filename>">
<!entity glibtop-free "<function>glibtop_free ()</function>">
<!entity glibtop-get-procmem "<function>glibtop_get_proc_mem ()</function>">
<!entity mmap "<function>mmap ()</function>">
<!entity MAP-SHARED "<parameter>MAP_SHARED</parameter>">
<!entity MAP-PRIVATE "<parameter>MAP_PRIVATE</parameter>">
<!entity pmem-vsize "<structfield>procmem.vsize</structfield>">
<!entity pmem-size "<structfield>procmem.size</structfield>">
<!entity pmem-resident "<structfield>procmem.resident</structfield>">
<!entity pmem-shared "<structfield>procmem.shared</structfield>">
<!entity pmem-rss "<structfield>procmem.rss</structfield>">
<!-- This will include a sample `libgtopConf.sh'. -->
<!entity example-libgtopConf-sh SYSTEM "libgtopConf.sh">
<!-- Some entities to include other files. -->
<!entity include-autoconf.sgml SYSTEM "autoconf.sgml">
<!entity include-reference.sgml SYSTEM "../guile/reference.sgml">
<!-- The following entities are used in the automatically generated
`reference.sgml' to include custom descriptions of the features.
-->
<!entity include-cpu.sgml "">
<!entity include-mem.sgml "">
<!entity include-swap.sgml "">
<!entity include-uptime.sgml SYSTEM "features/uptime.sgml">
<!entity include-loadavg.sgml "">
<!entity include-shm-limits.sgml "">
<!entity include-msg-limits.sgml "">
<!entity include-sem-limits.sgml "">
<!entity include-proclist.sgml SYSTEM "features/proclist.sgml">
<!entity include-proc-state.sgml "">
<!entity include-proc-uid.sgml "">
<!entity include-proc-mem.sgml SYSTEM "features/procmem.sgml">
<!entity include-proc-time.sgml "">
<!entity include-proc-signal.sgml "">
<!entity include-proc-kernel.sgml "">
<!entity include-proc-segment.sgml "">
<!entity include-proc-map.sgml "">
<!entity include-mountlist.sgml "">
<!entity include-fsusage.sgml "">
<!entity include-uptime.txt SYSTEM "features/uptime.txt">
]>
<book>
<bookinfo>
<title>Using Libgtop in the Gnome Project</title>
<authorgroup>
<author>
<firstname>Martin</firstname>
<surname>Baulig</surname>
<affiliation>
<address>
<email>martin@home-of-linux.org</email>
</address>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>1998</year>
<holder>Martin Baulig</holder>
</copyright>
<legalnotice>
<para>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
<para>
This library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
<para>
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
<para>
For more details see the file COPYING in the source
distribution of &libgtop;.</para>
</legalnotice>
<abstract>
<para>
<literal>
$Id$
</literal>
<para>
This is a short introduction in how to use
<productname>libgtop</productname> in the GNOME project.
It describes the additional options <filename>configure</filename>
takes and the information stored in the automatically generated
<filename>libgtopConf.sh</filename> configuration script.
<note>
<para>
Documentation about the new <function>table ()</function>
function can be found here:
<itemizedlist>
<listitem><para>
<ulink url="&home-of-linux;kernel/table/">
&home-of-linux;kernel/table/
</ulink>
</itemizedlist>
</note>
</abstract>
</bookinfo>
<toc></toc>
<chapter id="autoconf-automake">
<title>Configuration</title>
&include-autoconf.sgml;
</chapter>
<chapter id="functions">
<title>Function Reference List</title>
&include-reference.sgml;
</chapter>
<chapter id="porting-libgtop">
<title>Porting &libgtop; to other systems</title>
<para>
Here are some comments for people porting &libgtop; to other systems.
<sect1>
<title>&glibtop-get-procmem; - Process Memory information</title>
<para>
This section is copied here from the description of
&glibtop-get-procmem;.
</para>
&include-proc-mem.sgml;
</sect1>
</chapter>
</book>
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
End:
-->

107
doc/internals.texi Normal file
View File

@@ -0,0 +1,107 @@
@node LibGTop Internals, , Reference Manual, Top
@chapter LibGTop Internals
@menu
* General Internals:: General Internals
* Sysdeps Internals:: Sysdeps Internals
@end menu
@node General Internals, Sysdeps Internals, LibGTop Internals, LibGTop Internals
@section General Internals
@menu
* glibtop:: The server structure
@end menu
@node glibtop, , General Internals, General Internals
@subsection The server structure - @code{glibtop}
@example
@cartouche
typedef struct _glibtop glibtop;
struct _glibtop
@{
unsigned flags;
unsigned method;
unsigned error_method;
#ifdef HAVE_GLIBTOP_MACHINE_H
glibtop_machine machine;
#endif
int input [2];
int output [2];
int socket;
int ncpu;
unsigned long os_version_code;
const char *name;
const char *server_command;
const char *server_host;
const char *server_user;
const char *server_rsh;
unsigned long features;
unsigned long server_port;
glibtop_sysdeps sysdeps;
glibtop_sysdeps required;
glibtop_sysdeps wanted;
pid_t pid;
@};
@end cartouche
@end example
@node Sysdeps Internals, , General Internals, LibGTop Internals
@section Sysdeps Internals
@menu
* glibtop_open_s:: Non-privileged initializations
* glibtop_close_s:: Non-privileged cleanups
@end menu
@node glibtop_open_s, glibtop_close_s, Sysdeps Internals, Sysdeps Internals
@subsection glibtop_open_s
This function is used in the non-suid sysdeps library @samp{-lgtop_sysdeps} to
initialize a server. It should do all initializations that do not need any
privileges.
@example
@cartouche
void
glibtop_open_s (glibtop *server, const char *program_name,
const unsigned long features,
const unsigned flags);
@end cartouche
@end example
@table @code
@item server
Pointer to the @code{glibtop} server structure.
@item program_name
Name of the calling program; the implementation will usually
set @samp{server->name} to this so it'll be used as the program
name in error messages.
@end table
Typically, this function will set @code{server->name}, @code{server->ncpu} and
@code{server->os_version_code} and initialize any of the @code{server->machine}
fields which do not need any privileges.
It is normally implemented in @file{open.c} in the sysdeps directory.
@node glibtop_close_s, , glibtop_open_s, Sysdeps Internals
@subsection glibtop_close_s
This function is used in the non-suid sysdeps library @samp{-lgtop_sysdeps} to
clean-up a server when it's no longer used.
It must free all resources that were allocated in @code{glibtop_open_s}.
@example
@cartouche
void
glibtop_close_s (glibtop *server);
@end cartouche
@end example
It is normally implemented in @file{close.c} in the sysdeps directory, but may
be empty.

View File

@@ -1,12 +0,0 @@
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
]>
<style-specification id="libgtoprefdbtohtml" use="dbtohtml">
(define %output-basename% "libgtop-ref")
(define %output-directory% "libgtop-ref")
</style-specification>
<external-specification id="dbtohtml" document="dbtohtml.dsl">

View File

@@ -1,108 +0,0 @@
<!-- $Id$ -->
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
<!entity include-reference.sgml SYSTEM "../guile/reference.sgml" >
<!-- The following entities are used in the automatically generated
`reference.sgml' to include custom descriptions of the features.
-->
<!entity include-cpu.sgml "">
<!entity include-mem.sgml "">
<!entity include-swap.sgml "">
<!entity include-uptime.sgml "">
<!entity include-loadavg.sgml "">
<!entity include-shm-limits.sgml "">
<!entity include-msg-limits.sgml "">
<!entity include-sem-limits.sgml "">
<!entity include-proclist.sgml "">
<!entity include-proc-state.sgml "">
<!entity include-proc-uid.sgml "">
<!entity include-proc-mem.sgml "">
<!entity include-proc-time.sgml "">
<!entity include-proc-signal.sgml "">
<!entity include-proc-kernel.sgml "">
<!entity include-proc-segment.sgml "">
<!entity include-proc-map.sgml "">
<!entity include-mountlist.sgml "">
<!entity include-fsusage.sgml "">
]>
<book>
<bookinfo>
<title>LibGTop Reference Manual</title>
<authorgroup>
<author>
<firstname>Martin</firstname>
<surname>Baulig</surname>
<affiliation>
<address>
<email>martin@home-of-linux.org</email>
</address>
</affiliation>
</author>
</authorgroup>
<abstract>
<para>
<literal>$Id$</literal>
<para>
This reference manual is automatically generated from
<filename>doc/make-docbook.scm</filename>. It uses the
guile interface of <productname>libgtop</productname> to
get the names of all features the library defines and a
description of the structures.
</abstract>
<copyright>
<year>1998</year>
<holder>Martin Baulig</holder>
</copyright>
<legalnotice>
<para>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
<para>
This library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
<para>
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
<para>
For more details see the file COPYING in the source
distribution of LibGTop.</para>
</legalnotice>
</bookinfo>
<toc></toc>
<chapter id="functions">
<title>Function Reference List</title>
&include-reference.sgml;
</book>
<!--
Local Variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data: t
End:
-->

View File

@@ -1,12 +0,0 @@
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
]>
<style-specification id="libgtopdbtohtml" use="dbtohtml">
(define %output-basename% "libgtop")
(define %output-directory% "libgtop")
</style-specification>
<external-specification id="dbtohtml" document="dbtohtml.dsl">

File diff suppressed because it is too large Load Diff

80
doc/libgtop.texi Normal file
View File

@@ -0,0 +1,80 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename libgtop.info
@settitle LibGTop Reference Manual
@setchapternewpage odd
@c %**end of header
@include auto-macros.texi
@include version.texi
@ifinfo
This is the LibGTop Reference Manual version @value{VERSION}
(last modified @value{UPDATED}).
Copyright 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and
this permission notice are preserved on all copies.
@ignore
Permission is granted to process this file through TeX
and print the results, provided the printed document
carries a copying permission notice identical to this
one except for the removal of this paragraph (this
paragraph not being relevant to the printed manual).
@end ignore
Permission is granted to copy and distribute modified
versions of this manual under the conditions for
verbatim copying, provided also that the sections
entitled ``Copying'' and ``GNU General Public License''
are included exactly as in the original, and provided
that the entire resulting derived work is distributed
under the terms of a permission notice identical to this
one.
Permission is granted to copy and distribute
translations of this manual into another language,
under the above conditions for modified versions,
except that this permission notice may be stated in a
translation approved by the Free Software Foundation.
@end ifinfo
@titlepage
@title LibGTop Reference Manual
@subtitle Version @value{VERSION} - @value{UPDATED}
@author Martin Baulig
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and
this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified
versions of this manual under the conditions for
verbatim copying, provided also that the sections
entitled ``Copying'' and ``GNU General Public License''
are included exactly as in the original, and provided
that the entire resulting derived work is distributed
under the terms of a permission notice identical to this
one.
Permission is granted to copy and distribute
translations of this manual into another language,
under the above conditions for modified versions,
except that this permission notice may be stated in a
translation approved by the Free Software Foundation.
@end titlepage
@contents
@include main.texi
@bye

View File

@@ -1,35 +0,0 @@
#
# Configuration of the libgtop package
#
LIBGTOP_LIBDIR="/home/baulig/TEST/lib"
LIBGTOP_INCLUDEDIR="/home/baulig/TEST/include"
LIBGTOP_LIBS="-L/home/baulig/TEST/lib -lgtop -lgtop_common -lgtop_sysdeps -L/usr/X11R6/lib -lXau"
LIBGTOP_INCS="-I/home/baulig/TEST/include"
LIBGTOP_NAMES_LIBS="-L/home/baulig/TEST/lib -lgtop -lgtop_common -lgtop_sysdeps -lgtop_names -L/usr/X11R6/lib -lXau"
LIBGTOP_NAMES_INCS="-I/home/baulig/TEST/include -DGLIBTOP_NAMES"
LIBGTOP_GUILE_LIBS="-L/home/baulig/TEST/lib -lgtop -lgtop_guile -lgtop_common -lgtop_sysdeps -L/usr/X11R6/lib -lXau -L/home/baulig/INSTALL/lib -lguile -ldl -lreadline -ltermcap -lm"
LIBGTOP_GUILE_INCS="-I/home/baulig/TEST/include -I/home/baulig/INSTALL/include -DGLIBTOP_GUILE"
LIBGTOP_GUILE_NAMES_LIBS="-L/home/baulig/TEST/lib -lgtop -lgtop_guile -lgtop_common -lgtop_sysdeps -lgtop_names -L/usr/X11R6/lib -lXau"
LIBGTOP_GUILE_NAMES_INCS="-I/home/baulig/TEST/include -I/home/baulig/INSTALL/include -DGLIBTOP_GUILE -DGLIBTOP_NAMES"
LIBGTOP_BINDIR="/home/baulig/TEST/bin"
LIBGTOP_SERVER="/home/baulig/TEST/bin/libgtop_server"
LIBGTOP_MAJOR_VERSION="0"
LIBGTOP_MINOR_VERSION="2a"
LIBGTOP_VERSION="0.2a"
LIBGTOP_SERVER_VERSION="1"
libgtop_sysdeps_dir="linux"
libgtop_need_server="no"
libgtop_use_machine_h="no"
libgtop_guile_found="yes"
libgtop_want_examples=""

103
doc/main.texi Normal file
View File

@@ -0,0 +1,103 @@
@node Top, About, (dir), (dir)
@menu
* About:: About LibGTop
* White Paper:: LibGTop White Paper
* Reference Manual:: LibGTop Reference Manual
* LibGTop Internals:: LibGTop Internals
--- The Detailed Node Listing ---
About LibGTop
* Availability:: Where to get LibGTop
* Supported Platforms:: Supported Platforms
* Mailing List:: Helping with LibGTop development
* Thanks:: People who contributed to LibGTop
LibGTop White Paper
* Introduction:: Introduction
* Overview:: Overview
* Servers and Daemons:: Servers and Daemons
Overview
* Interface Design:: Things that need to be considered
* Server Implementation:: The LibGTop "server"
LibGTop Reference Manual
* System Dependent:: System Dependent Functions.
* Common Functions:: Common Functions.
* Library Functions:: Library Functions.
System Dependent Functions
* glibtop_cpu:: CPU Usage.
* glibtop_mem:: Memory Usage.
* glibtop_swap:: Swap Usage.
* glibtop_uptime:: System Uptime.
* glibtop_loadavg:: Load Average.
* glibtop_proclist:: Process List.
* glibtop_proc_state:: Process State.
* glibtop_proc_uid:: Process UID and TTY Information.
* glibtop_proc_mem:: Process Memory Information.
* glibtop_proc_time:: Process Time Information.
* glibtop_proc_signal:: Process Signal Information.
* glibtop_proc_kernel:: Process Kernel Data Information.
* glibtop_proc_segment:: Process Segment Information.
* glibtop_proc_args:: Process Arguments.
* glibtop_proc_map:: Process Memory Maps.
* glibtop_netload:: Network Load.
* glibtop_ppp:: PPP Usage.
Common Functions
* glibtop_mountlist:: Mount List.
* glibtop_fsusage:: File System Usage.
Library Functions
* glibtop_init:: Server Initialization.
* glibtop_sysdeps:: Server Sysdeps.
* Library Parameters:: Library Parameters.
LibGTop Internals
* General Internals:: General Internals
* Sysdeps Internals:: Sysdeps Internals
General Internals
* glibtop:: The server structure
Sysdeps Internals
* glibtop_open_s:: Non-privileged initializations
* glibtop_close_s:: Non-privileged cleanups
@end menu
@include about.texi
@include white-paper.texi
@include reference.texi
@include internals.texi

1791
doc/reference.texi Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,161 +0,0 @@
Path: news.uni-stuttgart.de!fu-berlin.de!taurus.uni-trier.DE!baulig
From: Martin Baulig <baulig@merkur.uni-trier.de>
Newsgroups: comp.os.linux.development.system
Subject: RFC: New system call for /proc information ?
Date: 07 Jun 1998 20:22:47 +0200
Lines: 143
Sender: baulig@Taurus.uni-trier.de
Message-ID: <of7zpfprs08.fsf@Taurus.uni-trier.de>
NNTP-Posting-Host: taurus.uni-trier.de (136.199.14.201)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-User: baulig
X-Access: 16 1542 1543
X-Trace: fu-berlin.de 897243777 29527 baulig 136.199.14.201
X-Newsreader: Gnus v5.6.11/XEmacs 20.3 - "Vatican City"
Xref: news.uni-stuttgart.de comp.os.linux.development.system:73539
[Posted to the Gnome Mailing List and to comp.os.linux.development.system]
Request for Comments:
====================
Should we have a new system call under Linux which fetches information
from the /proc filesytem similar to the table() function of DEC OSF/1 ?
The whole story:
===============
I am currently working on libgtop, a library that fetches information
from the proc filesystem for user processes. This library uses a suid
server on system where this is required. On Linux, the information are
fetched directly from the proc filesystem.
Now, I made some profilings (fetches 50000 times cpu, memory, swap,
uptime and loadavg):
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ns/call ns/call name
91.86 348.03 348.03 read
3.07 359.67 11.64 open
0.67 362.22 2.55 close
0.16 363.55 0.62 memset
0.16 364.14 0.59 __ipc
0.03 368.84 0.12 vsscanf (iovsscanf.c:31)
0.01 374.49 0.05 sscanf (sscanf.c:28)
0.00 378.71 0.01 semctl (semctl.c:32)
0.00 378.73 0.01 shmctl (shmctl.c:30)
granularity: each sample hit covers 4 byte(s) for 0.00% of 378.88 seconds
index % time self children called name
[1] 91.9 348.03 0.00 read [1]
-----------------------------------------------
[2] 3.1 11.64 0.00 open [2]
-----------------------------------------------
[3] 0.7 2.55 0.00 close [3]
-----------------------------------------------
[5] 0.2 0.62 0.00 memset [5]
-----------------------------------------------
[6] 0.2 0.59 0.00 __ipc [6]
-----------------------------------------------
[35] 0.0 0.12 0.00 vsscanf (iovsscanf.c:31) [35]
-----------------------------------------------
[96] 0.0 0.05 0.00 sscanf (sscanf.c:28) [96]
-----------------------------------------------
You see, it spends a lot of time in read() which is only used to read the
data from the files in /proc. Well, basically one can say that these
timings are not so bad, normally a process periodically fetches those
information say 10 times a seconds which makes 36000 invocations per
hour.
This will make a total of about 250 seconds per hour or on even say:
``a program fetching those information at a frequency of 10 will take
about 7 % of each hour just for reading files from /proc''.
Now look at timings of __ipc, they're about 350 times better 'cause this
is done using system calls.
So far so good, now look at how this is done on the DEC OSF/1 port of the
library (the following code is part of libgtop - GPL/LGPL):
CPU usage:
{
struct tbl_sysinfo sysinfo;
int ret;
ret = table (TBL_SYSINFO, 0, (char *) &sysinfo, 1,
sizeof (struct tbl_sysinfo));
buf->user = sysinfo.si_user;
buf->nice = sysinfo.si_nice;
buf->sys = sysinfo.si_sys;
buf->idle = sysinfo.si_idle;
}
Well, the table() command of DEC OSF/1 has may disadvantages, too - such
as requiring to be root to fetch any information about processes (well, for
each process that is not the current one).
But this works using system calls rather that reading and parsing files
and should be about as fast as getting the IPC information on Linux.
Under Linux, the current trend seems to be to move anything into the /proc
filesystem, but if you look at the timings, wouldn't it be better to also
implement a system call interface ?
Don't understand me wrong:
=========================
I *do not want* to *replace* the /proc filesystem - it's an excellent
idea to be able to fetch all information on the command line without
any program just a simple 'cat' - I want to *add* a *new* system call
to allow programmers to fetch those information faster that reading
from /proc.
To come to the point:
=====================
Is there any public interest in having a new system call under Linux
which can be used to fetch all information that are currently in the
/proc filesystem.
Basically, this system would be defined like this:
asmlinkage int
sys_table (int command, struct sysinfo_table *buf)
and be invoked like this:
#include <sys/table.h>
{
struct sysinfo_cpu cpu;
struct sysinfo_mem mem;
ret = table (TABLE_CPU, &cpu);
if (ret == -1) return; /* or invoke any error handler */
ret = table (TABLE_MEM, &mem);
if (ret == -1) return;
}
What do you think, folks. Should we have such a system call under Linux ?
I can do the implementation of this system call, but I want to have some
feedback first.
Martin
--
-----------------------------------------------------------------
Martin Baulig - Angewandte Mathematik - Universitaet Trier
baulig@castor.uni-trier.de, http://www.home-of-linux.com/
Key: 1024-bit key with ID C8178435 created 1997/01/24
ID: 67 C1 84 A0 47 F5 11 C5 5F 68 4C 84 99 05 C3 92
Finger me for public key or fetch finger.txt from the url above
------------------------------------------------------------------

View File

@@ -1,12 +0,0 @@
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
]>
<style-specification id="tabledbotohtml" use="dbtohtml">
(define %output-basename% "table")
(define %output-directory% "table")
</style-specification>
<external-specification id="dbtohtml" document="dbtohtml.dsl">

View File

@@ -1,193 +0,0 @@
<!-- $Id$ -->
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
<!entity libgtopConf.sh SYSTEM "../libgtopConf.sh" >
<!entity home-of-linux "http://www.home-of-linux.org/">
<!entity table-announce-first "&home-of-linux;kernel/table/ANNOUNCE.FIRST">
<!entity table20-tgz "&home-of-linux;kernel/table/table20.tgz">
<!entity table21-tgz "&home-of-linux;kernel/table/table21.tgz">
<!entity news-c-o-l-d-s "comp.os.linux.development.system">
<!entity libgtop "<productname>libgtop</productname>">
<!entity table "<function>table ()</function>">
]>
<book>
<bookinfo>
<title>The &table; system call under Linux</title>
<authorgroup>
<author>
<firstname>Martin</firstname>
<surname>Baulig</surname>
<affiliation>
<address>
<email>martin@home-of-linux.org</email>
</address>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>1998</year>
<holder>Martin Baulig</holder>
</copyright>
<legalnotice>
<para>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
<para>
This library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
<para>
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
<para>
For more details see the file COPYING in the source
distribution of LibGTop.</para>
</legalnotice>
<abstract>
<para>
<literal>$Id$</literal>
<para>
Under <productname>Linux</productname>, reading from
<filename>/proc</filename> is somehow slow because the data
needs to be converted into a stringified representation from
the kernel and to be parsed from the application program to
get the original data back.
While doing the <productname>DEC OSF/1</productname> port of
&libgtop; I got the idea to add something similar to the &table;
function there to the Linux kernel.
This is what this document is about.
</abstract>
</bookinfo>
<toc></toc>
<chapter id="why-not-sysctl">
<title>Why not <function>sysctl</function>?</title>
<para>
Some weeks ago, I posted the initial proposal of the project to
<ulink url="news:&news-c-o-l-d-s;">&news-c-o-l-d-s;</ulink> with
Message-ID <literal>&lt;of7zpfprs08.fsf@Taurus.uni-trier.de&gt;</literal>.
<para>
You can also read this article at my site:
<itemizedlist>
<listitem><para>
<ulink url="&table-announce-first;">&table-announce-first;</ulink>
</itemizedlist>
<para>
Some people told me to include all the stuff into
<function>sysctl</function> instead of inventing a new system call.
<para>
Basically this is a good idea, but the main problem with
<function>sysctl</function> is that this should be applied to standard
kernels and not just as a short patch. Well, AFAIK something similar
is on the "wish list" for 2.2er kernels - but of cause it'll need some
time until we have a real replacement of the <filename>/proc</filename>
filesystem in <function>sysctl</function>.
<para>
If someone thinks that this absolutely should be included in
<function>sysctl</function>: think about some kind of interface,
discuss it with the kernel developers, ...
<chapter id="about-table">
<title>About the &table; function</title>
<para>
Using the &table; function will not affect any existing kernel
structures and can be done independent from kernel development.
<para>
So it can easily be used in &libgtop; until we have something
simliar in standard kernels.
<para>
If you want to use the &table; function in your own programs, be
aware that it is just intended to be some kind of quick solution
for &libgtop; until there's something better in standard kernels.
<chapter id="how-to-use">
<title>How to use the &table; function in &libgtop;</title>
<para>
The source code of the &table; function is distributed together with
&libgtop;. It can be found in the <filename>kernel/table20</filename>
directory for 2.0.xx kernels and in the <filename>kernel/table21</filename>
directory for 2.1.xx kernels.
<para>
You can also download it from my site:
<itemizedlist>
<listitem><para>
<ulink url="&table20-tgz;">&table20-tgz</ulink>
(for kernel 2.0.xx)
<listitem><para>
<ulink url="&table21-tgz;">&table21-tgz</ulink>
(for kernel 2.1.xx)
</itemizedlist>
<para>
Copy the contents of the appropriate directory to
<filename>/usr/src/linux/table</filename>, apply the
patch to the kernel and re-configure &libgtop;.
<para>
After that, you can unmount <filename>/proc</filename> and
&libgtop; will still work !
<note>
<para>
Maybe one could consider this as a bug, but currently there
isn't a configuration option to disable the &table; function
once you applied the patch ...
</note>
<note>
<para>
Currently I'm working on the 2.1.x version to implement some
features newer kernels have - so the 2.0.x version may not
have all features the 2.1.x one has.
</note>
<note>
<para>
The 2.1.x version of the &table; function is implemented
as a kernel module. You have to do a
<command>insmod table/module.o</command> manually to use it.
<para>
This has the advantage that you don't need to reboot if you
want to play around with the code a little bit.
</note>
</book>
<!--
Local Variables:
mode: sgml
sgml-indent-data: t
End:
-->

136
doc/white-paper.texi Normal file
View File

@@ -0,0 +1,136 @@
@node White Paper, Reference Manual, About, Top
@chapter LibGTop White Paper
@menu
* Introduction:: Introduction
* Overview:: Overview
* Servers and Daemons:: Servers and Daemons
@end menu
@node Introduction, Overview, White Paper, White Paper
@section Introduction
Many modern UNIX systems like Solaris, BSD or Digitial Unix only allow
priviledged processes to read information like CPU and Memory Usage or
information about running processes.
@itemize @bullet
@item
BSD, for instance, doesn't have any other way to get those data than reading
directly from @file{/dev/kmem} and you need to be in the @code{kmem} group to
be able to read this.
@item
Other systems, like Digital Unix, allow all users to get things like CPU and
Memory statistics, but only root may read information about any process other
than the current one (you may not even get information about your own processes
if you're not root).
@item
Linux has a very nice @file{/proc} filesystem, but reading and parsing
@file{/proc} is very slow and inefficient.
@item
Solaris is a bit better, but you still need to be in the @code{sys} group or
even root to get some data.
@end itemize
Because of this system utilities like @code{ps}, @code{uptime} or @code{top}
often are setgid kmem or setuid root. Usually, they're also very specific to
the system they're written for and not easily portable to other systems without
a lot of work.
This, of cause, becomes a problem for graphical tools like @code{gtop} - making
a GTK+ program setgid or even setuid would be a security hole as big as you can
drive the entire X11 source code through. For the GNOME project, we also needed
some kind of library which provides all the required information in a portable
since there's more than just one single program that wants to use them - for
instance @code{gtop} and the @code{multiload}, @code{cpumemusage} and
@code{netload} panel applets.
@node Overview, Servers and Daemons, Introduction, White Paper
@section Overview
This section should give you a short overview on how LibGTop was developed, which
things needed to be considered and how it works.
@menu
* Interface Design:: Things that need to be considered
* Server Implementation:: The LibGTop "server"
@end menu
@node Interface Design, Server Implementation, Overview, Overview
@subsection Interface Design
At the very beginning, it was necessary to collect all the data the library part
should provide and put them into some C structures. This was not that easiy as it
might sound since LibGTop should be portable to any modern UNIX system with a common
library part on all those systems, but the data that should be returned vary from
system to system. For instance some systems support shared memory, but some others
may not.
The header files where we define these C structures (which are system-independent) are
shared between client and server. This way we can call the system dependent code
directly where we do not need any special privileges to do so.
All of those structures contain a @code{flags} member which is interpreted as a bit
mask and tells the caller of the library functions which of the fields in the returned
structure are valid and which are not.
@node Server Implementation, , Interface Design, Overview
@subsection Server Implementation
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.
@node Servers and Daemons, , Overview, White Paper
@section Servers and Daemons
LibGTop gives you the possibility to use different LibGTop "servers" and
"daemons" in your application.
Normally you do not need to worry about this things since LibGTop auto-
matically opens a pipe to its server it it's required, but this can also
be customized to fit your needs.
For instance if you have a small applet which is only interested in disk
usage there's no need to fork a separate server process since you don't
need any privileges to get them on any of the supported systems. This can
be archieved with a special call to @code{glibtop_init_r} on startup.
There's also an option to tell @code{glibtop_init_r} that you're only
interested in several features - for instance cpu and memory usage. In
this case LibGTop will only fork a server process if it's required to get
cpu and memory.
You can also tell @code{glibtop_init_r} to start the server only on demand,
this might become useful in command-line based programs. For graphical
applications it's normally best to start the server directly during their
initialization. The same applies for any time critical applications (since
@code{fork} is an expensive operation on some systems this may lead to
incorrect statistics).
LibGTop also allows you to talk to a remote machine using the
@dfn{LibGTop daemon}. This daemon is based on @code{gnuserv} from
GNU Emacs and should be run as an unprivileged user. It has support
for either @code{xauth} or host based authorization.
This daemon itself behaves like a LibGTop client application, i.e. it
forks a server process if this is required.
The main use for this daemon is when you want to monitor a machine which
is either very slow or has very low disk space. In this case you don't need
to install the whole client application (for instance GTop) on the remote
machine but only a very small (maybe also statically linked) executable and
run the graphical application on a more powerful machine.
It can also be used to monitor a remote machine over a very slow link such
as a dialup connection since the conversation between LibGTop client and
daemon uses much less bandwith than an ordinary X11 connection.

View File

@@ -11,3 +11,6 @@ third_linux
third_static
second_static
second_linux
smp_static sysdeps_static netload_static procmap_static mountlist_static
smp sysdeps netload procmap mountlist
timings timings_static

View File

@@ -1,3 +1,69 @@
1999-05-28 Martin Baulig <martin@home-of-linux.org>
* first.c, second.c, sysdeps.c: Use LibGTop version conditionals
so we can more easily merge the code into LIBGTOP_STABLE_1_0.
1999-05-08 Drazen Kacar <dave@srce.hr>
* mountlist.c: Changed pfintf formats to "%lld" when printing
u_int64_t. This is still utterly unportable, but will
hopefully work on all supported architectures. For now.
1999-05-07 Martin Baulig <martin@home-of-linux.org>
* timings.c (timersub): Renamed this to `libgtop_timersub' and define
it on all systems.
Fri Apr 9 00:14:52 1999 Timur Bakeyev <timur@gnu.org>
* timings.c: Added timersub defenition, to make code compilable on
BSDI.
1999-03-24 Martin Baulig <martin@home-of-linux.org>
* timings.c: New example.
1999-03-17 Martin Baulig <martin@home-of-linux.org>
* first.c, second.c: Fixed a bug that caused a core dump when
the sysdeps code does not return all data.
1998-11-22 Martin Baulig <baulig@taurus.uni-trier.de>
* netload.c: Call inet_ntoa () to get address and subnet
in quatted dot notation (like 136.199.14.201) and not just
as a number (like 0xc90ec788).
1998-11-02 Martin Baulig <martin@home-of-linux.org>
* sysdeps.c: New example.
1998-10-26 Martin Baulig <martin@home-of-linux.org>
* netload.c: New file. Gets network load for the interface
given as command line argument.
1998-10-26 Martin Baulig <martin@home-of-linux.org>
* first.c (glibtop_get_proc_args): Get command line arguments.
* second.c: Likewise.
1998-10-25 Martin Baulig <martin@home-of-linux.org>
* first.c (glibtop_get_ppp): Get PPP/ISDN statistics.
1998-09-28 Martin Baulig <martin@home-of-linux.org>
* Makefile.am: Install everything in $(libexecdir)/libgtop.
1998-09-09 Martin Baulig <baulig@Stud.Informatik.uni-trier.de>
* smp.c: New file. Nice tool to show CPU statistics on SMP systems.
1998-08-25 Martin Baulig <martin@home-of-linux.org>
* first.c, second.c, procmap.c: Fixed some compiler warnings.
1998-08-18 Martin Baulig <martin@home-of-linux.org>
* procmap.c: We now display filenames when compiled

View File

@@ -2,25 +2,30 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
CFLAGS = -Wall -W @CFLAGS@ -O0
INCLUDES = @INCLUDES@
DEFS = @DEFS@
# We install it in `libexec' since this will make it more easy
# to put the examples into an extra RPM package.
libexec_PROGRAMS = first first_static second second_static \
mountlist mountlist_static \
procmap procmap_static \
@guile_examples@
libgtopdir = $(libexecdir)/libgtop
EXTRA_PROGRAMS = third third_static
libgtop_PROGRAMS = first second\
mountlist procmap netload sysdeps timings \
@static_targets@ @guile_examples@ @smp_examples@
EXTRA_PROGRAMS = first_static second_static \
mountlist_static procmap_static \
third third_static smp smp_static \
netload_static sysdeps_static \
timings_static
first_SOURCES = first.c
first_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@INTLLIBS@ @LIBSUPPORT@ @LIBGTOP_EXTRA_LIBS@
@LIBSUPPORT@ @INTLLIBS@
first_static_SOURCES = $(first_SOURCES)
first_static_LDADD = $(first_LDADD)
@@ -30,7 +35,7 @@ second_SOURCES = second.c
second_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@INTLLIBS@ @LIBSUPPORT@ @LIBGTOP_EXTRA_LIBS@
@LIBSUPPORT@ @INTLLIBS@
second_static_SOURCES = $(second_SOURCES)
second_static_LDADD = $(second_LDADD)
@@ -40,13 +45,33 @@ procmap_SOURCES = procmap.c
procmap_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@INTLLIBS@ @LIBSUPPORT@ @LIBGTOP_EXTRA_LIBS@
@LIBSUPPORT@ @INTLLIBS@
procmap_static_SOURCES = $(procmap_SOURCES)
procmap_static_LDADD = $(procmap_LDADD)
procmap_static_LDFLAGS = -static
netload_SOURCES = netload.c
netload_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@LIBSUPPORT@ @INTLLIBS@
netload_static_SOURCES = $(netload_SOURCES)
netload_static_LDADD = $(netload_LDADD)
netload_static_LDFLAGS = -static
sysdeps_SOURCES = sysdeps.c
sysdeps_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@LIBSUPPORT@ @INTLLIBS@
sysdeps_static_SOURCES = $(sysdeps_SOURCES)
sysdeps_static_LDADD = $(sysdeps_LDADD)
sysdeps_static_LDFLAGS = -static
third_guile_names_LIBS = $(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la
third_names_LIBS = $(top_builddir)/sysdeps/names/libgtop_names.la
@@ -57,8 +82,7 @@ third_LDADD = $(top_builddir)/sysdeps/guile/libgtop_guile.la \
$(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@ \
@LIBGTOP_EXTRA_LIBS@
@GUILE_LIBS@ @LIBSUPPORT@ @INTLLIBS@
third_static_SOURCES = $(third_SOURCES)
third_static_LDADD = $(third_LDADD)
@@ -68,9 +92,30 @@ mountlist_SOURCES = mountlist.c
mountlist_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@INTLLIBS@ @LIBSUPPORT@ @LIBGTOP_EXTRA_LIBS@
@LIBSUPPORT@ @INTLLIBS@
mountlist_static_SOURCES= $(mountlist_SOURCES)
mountlist_static_LDADD = $(mountlist_LDADD)
mountlist_static_LDFLAGS= -static
smp_SOURCES = smp.c
smp_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@LIBSUPPORT@ @INTLLIBS@
smp_static_SOURCES = $(smp_SOURCES)
smp_static_LDADD = $(smp_LDADD)
smp_static_LDFLAGS = -static
timings_SOURCES = timings.c
timings_LDADD = $(top_builddir)/lib/libgtop.la \
$(top_builddir)/sysdeps/common/libgtop_common.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
@LIBSUPPORT@ @INTLLIBS@
timings_static_SOURCES = $(timings_SOURCES)
timings_static_LDADD = $(timings_LDADD)
timings_static_LDFLAGS = -static

View File

@@ -1,23 +1,25 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
@@ -44,9 +46,8 @@ main (int argc, char *argv [])
glibtop_sysdeps sysdeps;
unsigned c, method, count, port, i, *ptr;
char buffer [BUFSIZ];
struct rlimit rlim;
struct rusage ru;
pid_t pid, ppid;
char *args;
count = PROFILE_COUNT;
@@ -115,9 +116,16 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_uptime (&data.uptime);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Uptime (0x%08lx): %f, %f, %lu\n",
(unsigned long) data.uptime.flags,
data.uptime.uptime, data.uptime.idletime,
(unsigned long) data.uptime.boot_time);
#else
printf ("Uptime (0x%08lx): %f, %f\n",
(unsigned long) data.uptime.flags,
data.uptime.uptime, data.uptime.idletime);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_loadavg (&data.loadavg);
@@ -174,10 +182,22 @@ main (int argc, char *argv [])
printf ("\n");
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_ppp (&data.ppp, 0);
printf ("PPP (0x%08lx): %lu, %lu, %lu\n",
(unsigned long) data.ppp.flags,
(unsigned long) data.ppp.state,
(unsigned long) data.ppp.bytes_in,
(unsigned long) data.ppp.bytes_out);
printf ("\n");
glibtop_get_sysdeps (&sysdeps);
printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, "
"%lu, %lu, %lu, %lu, %lu, %lu\n",
(unsigned long) sysdeps.flags,
(unsigned long) sysdeps.cpu,
(unsigned long) sysdeps.mem,
@@ -194,7 +214,13 @@ main (int argc, char *argv [])
(unsigned long) sysdeps.proc_time,
(unsigned long) sysdeps.proc_signal,
(unsigned long) sysdeps.proc_kernel,
(unsigned long) sysdeps.proc_segment);
(unsigned long) sysdeps.proc_segment,
(unsigned long) sysdeps.proc_args,
(unsigned long) sysdeps.proc_map,
(unsigned long) sysdeps.mountlist,
(unsigned long) sysdeps.fsusage,
(unsigned long) sysdeps.netload,
(unsigned long) sysdeps.ppp);
printf ("\n");
@@ -223,16 +249,54 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, pid);
printf ("Proc_State PID %5u (0x%08lx): '%s', %c, %u, %u\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid);
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
(int) pid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, pid);
printf ("Proc_Uid PID %5u (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) pid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -240,19 +304,13 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, pid);
getrlimit (RLIMIT_RSS, &rlim);
fprintf (stderr, "GETRLIM: %lu - %lu - %lu\n",
(unsigned long) rlim.rlim_cur,
(unsigned long) rlim.rlim_max,
(unsigned long) ((1 << 63) - 1));
printf ("Proc_Mem PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", pid,
printf ("Proc_Mem PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -264,8 +322,32 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, pid);
printf ("Proc_Segment PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -275,18 +357,13 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack);
getrusage (RUSAGE_SELF, &ru);
fprintf (stderr, "GETRUSAGE: (%ld, %ld) - (%ld, %ld)\n",
ru.ru_utime.tv_sec, ru.ru_utime.tv_usec,
ru.ru_stime.tv_sec, ru.ru_stime.tv_usec);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, pid);
printf ("Proc_Time PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
printf ("Proc_Time PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -301,19 +378,33 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, pid);
printf ("Proc_Signal PID %5u (0x%08lx): "
"%lu %lu %lu %lu\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, pid);
printf ("Proc_Kernel PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", pid,
printf ("Proc_Kernel PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -327,19 +418,73 @@ main (int argc, char *argv [])
printf ("\n");
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
for (i = 0; i < data.proc_args.size; i++) {
if (args [i]) continue;
args [i] = '|';
}
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
args ? args : "");
glibtop_free (args);
printf ("\n");
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, ppid);
printf ("Proc_State PPID %5u (0x%08lx): '%s', %c, %u, %u\n", ppid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PPID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) ppid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid);
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
(int) ppid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, ppid);
printf ("Proc_Uid PPID %5u (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", ppid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PPID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) ppid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PPID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -347,12 +492,13 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, ppid);
printf ("Proc_Mem PPID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", ppid,
printf ("Proc_Mem PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -364,8 +510,32 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, ppid);
printf ("Proc_Segment PPID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) ppid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -375,12 +545,13 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, ppid);
printf ("Proc_Time PPID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
printf ("Proc_Time PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -395,18 +566,32 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, ppid);
printf ("Proc_Signal PPID %5u (0x%08lx): %lu %lu %lu %lu\n", ppid,
(unsigned long) data.proc_signal.flags,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PPID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n",
(int) ppid, (unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n",
(int) ppid, (unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
printf ("Proc_Kernel PPID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", ppid,
printf ("Proc_Kernel PPID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) ppid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -420,18 +605,72 @@ main (int argc, char *argv [])
printf ("\n");
args = glibtop_get_proc_args (&data.proc_args, ppid, 0);
for (i = 0; i < data.proc_args.size; i++) {
if (args [i]) continue;
args [i] = '|';
}
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
args ? args : "");
glibtop_free (args);
printf ("\n");
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, 1);
printf ("Proc_State INIT %5u (0x%08lx): '%s', %c, %u, %u\n", 1,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State INIT %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", 1,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid);
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, 1);
printf ("Proc_Uid INIT %5u (0x%08lx): "
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid INIT %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d", 1,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid INIT %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
@@ -440,11 +679,12 @@ main (int argc, char *argv [])
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, 1);
printf ("Proc_Mem INIT %5u (0x%08lx): "
printf ("Proc_Mem INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
@@ -457,7 +697,31 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, 1);
printf ("Proc_Segment INIT %5u (0x%08lx): "
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", 1,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
@@ -468,11 +732,12 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, 1);
printf ("Proc_Time INIT %5u (0x%08lx): "
printf ("Proc_Time INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
@@ -488,19 +753,33 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, 1);
printf ("Proc_Signal INIT %5u (0x%08lx): "
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal INIT %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", 1,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal INIT %5d (0x%08lx): "
"%lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch);
#endif
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, 1);
printf ("Proc_Kernel INIT %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", 1,
printf ("Proc_Kernel INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", 1,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -512,6 +791,22 @@ main (int argc, char *argv [])
(unsigned long) data.proc_kernel.nwchan,
data.proc_kernel.wchan);
printf ("\n");
args = glibtop_get_proc_args (&data.proc_args, 1, 0);
for (i = 0; i < data.proc_args.size; i++) {
if (args [i]) continue;
args [i] = '|';
}
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
args ? args : "");
glibtop_free (args);
glibtop_close ();
exit (0);

View File

@@ -1,23 +1,25 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
@@ -94,7 +96,7 @@ main (int argc, char *argv [])
glibtop_get_fsusage (&fsusage,
mount_entries [index].mountdir);
printf ("Usage: %-16s %9Lu %9Lu %9Lu %9Lu %9Lu\n",
printf ("Usage: %-16s %9llu %9llu %9llu %9llu %9llu\n",
mount_entries [index].mountdir,
fsusage.blocks, fsusage.bfree,
fsusage.bavail, fsusage.files,

125
examples/netload.c Normal file
View File

@@ -0,0 +1,125 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>
#include <glibtop/xmalloc.h>
#include <glibtop/parameter.h>
#include <glibtop/netload.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef PROFILE_COUNT
#define PROFILE_COUNT 1
#endif
int
main (int argc, char *argv [])
{
glibtop_netload netload;
unsigned method, count, port, i;
struct in_addr addr, subnet;
char *address_string, *subnet_string;
char buffer [BUFSIZ];
count = PROFILE_COUNT;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
printf ("Method = %d\n", method);
count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
buffer [count] = 0;
printf ("Command = '%s'\n", buffer);
count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
buffer [count] = 0;
glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
printf ("Host = '%s' - %u\n\n", buffer, port);
glibtop_init_r (&glibtop_global_server, 0, 0);
if (argc != 2)
glibtop_error ("Usage: %s interface", argv [0]);
glibtop_get_netload (&netload, argv [1]);
addr.s_addr = netload.address;
subnet.s_addr = netload.subnet;
address_string = glibtop_strdup (inet_ntoa (addr));
subnet_string = glibtop_strdup (inet_ntoa (subnet));
printf ("Network Load (0x%08lx):\n\n"
"\tInterface Flags:\t0x%08lx\n"
"\tAddress:\t\t0x%08lx - %s\n"
"\tSubnet:\t\t\t0x%08lx - %s\n\n"
"\tMTU:\t\t\t%ld\n"
"\tCollisions:\t\t%ld\n\n"
"\tPackets In:\t\t%ld\n"
"\tPackets Out:\t\t%ld\n"
"\tPackets Total:\t\t%ld\n\n"
"\tBytes In:\t\t%ld\n"
"\tBytes Out:\t\t%ld\n"
"\tBytes Total:\t\t%ld\n\n"
"\tErrors In:\t\t%ld\n"
"\tErrors Out:\t\t%ld\n"
"\tErrors Total:\t\t%ld\n\n",
(unsigned long) netload.flags,
(unsigned long) netload.if_flags,
(unsigned long) netload.address, address_string,
(unsigned long) netload.subnet, subnet_string,
(unsigned long) netload.mtu,
(unsigned long) netload.collisions,
(unsigned long) netload.packets_in,
(unsigned long) netload.packets_out,
(unsigned long) netload.packets_total,
(unsigned long) netload.bytes_in,
(unsigned long) netload.bytes_out,
(unsigned long) netload.bytes_total,
(unsigned long) netload.errors_in,
(unsigned long) netload.errors_out,
(unsigned long) netload.errors_total);
glibtop_free (address_string);
glibtop_free (subnet_string);
glibtop_close ();
exit (0);
}

View File

@@ -1,23 +1,25 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
@@ -79,14 +81,14 @@ main (int argc, char *argv [])
glibtop_init_r (&glibtop_global_server, 0, 0);
if ((argc != 2) || (sscanf (argv [1], "%d", &pid) != 1))
if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1))
glibtop_error ("Usage: %s pid", argv [0]);
#ifdef GLIBTOP_INODEDB
inodedb = glibtop_inodedb_open (0, 0);
#endif
fprintf (stderr, "Getting memory maps for pid %d.\n\n", pid);
fprintf (stderr, "Getting memory maps for pid %d.\n\n", (int) pid);
maps = glibtop_get_proc_map (&procmap, pid);
@@ -95,7 +97,7 @@ main (int argc, char *argv [])
unsigned device, device_major, device_minor;
char perm [5];
if (maps [i].flags & (1 << GLIBTOP_MAP_ENTRY_FILENAME))
if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME))
filename = maps [i].filename;
#ifdef GLIBTOP_INODEDB
@@ -114,24 +116,41 @@ main (int argc, char *argv [])
device_minor = (device & 255);
device_major = ((device >> 8) & 255);
if (filename)
fprintf (stderr, "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s - %s\n",
if (filename) {
char *format;
if (sizeof (void*) == 8)
format = "%016lx-%016lx %016lx - "
"%02x:%02x %08lu - %4s - %s\n";
else
format = "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s - %s\n";
fprintf (stderr, format,
(unsigned long) maps [i].start,
(unsigned long) maps [i].end,
(unsigned long) maps [i].offset,
device_major, device_minor,
(unsigned long) maps [i].inode,
perm, filename);
else
fprintf (stderr, "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s\n",
} else {
char * format;
if (sizeof (void*) == 8)
format = "%016lx-%016lx %016lx - "
"%02x:%02x %08lu - %4s\n";
else
format = "%08lx-%08lx %08lx - "
"%02x:%02x %08lu - %4s\n";
fprintf (stderr, format,
(unsigned long) maps [i].start,
(unsigned long) maps [i].end,
(unsigned long) maps [i].offset,
device_major, device_minor,
(unsigned long) maps [i].inode,
perm);
}
if (filename && (filename != maps [i].filename))
glibtop_free (filename);

View File

@@ -1,23 +1,25 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
@@ -29,25 +31,76 @@
#include <glibtop/union.h>
#include <glibtop/sysdeps.h>
#include <math.h>
static void
output (pid_t pid)
{
glibtop_union data;
char *args;
unsigned i;
#if HAVE_LIBGTOP_SMP
unsigned long total;
double p_total, p_utime, p_stime;
double b_total, b_utime, b_stime;
double s_total, s_utime, s_stime;
double my_utime, my_stime;
int ncpu;
#endif
printf ("\n");
glibtop_get_proc_state (&data.proc_state, pid);
printf ("Proc_State PID %5u (0x%08lx): "
"'%s', %c, %u, %u\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_State PID %5d (0x%08lx): '%s', %u - "
"%u, %u, %u, %u - %u, %u, %u\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
data.proc_state.uid, data.proc_state.gid);
data.proc_state.uid, data.proc_state.gid,
data.proc_state.ruid, data.proc_state.rgid,
data.proc_state.has_cpu, data.proc_state.processor,
data.proc_state.last_processor);
#else
printf ("Proc_State PID %5d (0x%08lx): "
"'%s', %c, %lu, %lu\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
(unsigned long) data.proc_state.uid,
(unsigned long) data.proc_state.gid);
#endif
glibtop_get_proc_uid (&data.proc_uid, pid);
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d - %d",
(int) pid, (unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
data.proc_uid.suid, data.proc_uid.sgid,
data.proc_uid.fsuid, data.proc_uid.fsgid,
data.proc_uid.pid, data.proc_uid.ppid,
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice,
data.proc_uid.ngroups);
printf ("Proc_Uid PID %5u (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", pid,
if (data.proc_uid.ngroups) {
for (i = 0; i < data.proc_uid.ngroups; i++) {
if (i)
printf (" %d", data.proc_uid.groups [i]);
else
printf (" (%d", data.proc_uid.groups [i]);
}
printf (")");
}
printf ("\n");
#else
printf ("Proc_Uid PID %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -55,11 +108,12 @@ output (pid_t pid)
data.proc_uid.pgrp, data.proc_uid.session,
data.proc_uid.tty, data.proc_uid.tpgid,
data.proc_uid.priority, data.proc_uid.nice);
#endif
glibtop_get_proc_mem (&data.proc_mem, pid);
printf ("Proc_Mem PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", pid,
printf ("Proc_Mem PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -70,8 +124,32 @@ output (pid_t pid)
glibtop_get_proc_segment (&data.proc_segment, pid);
printf ("Proc_Segment PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx 0x%lx "
"0x%lx 0x%lx 0x%lx 0x%lx\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
(unsigned long) data.proc_segment.data_rss,
(unsigned long) data.proc_segment.stack_rss,
(unsigned long) data.proc_segment.dirty_size,
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_data,
(unsigned long) data.proc_segment.end_data,
(unsigned long) data.proc_segment.start_brk,
(unsigned long) data.proc_segment.end_brk,
(unsigned long) data.proc_segment.start_stack,
(unsigned long) data.proc_segment.start_mmap,
(unsigned long) data.proc_segment.arg_start,
(unsigned long) data.proc_segment.arg_end,
(unsigned long) data.proc_segment.env_start,
(unsigned long) data.proc_segment.env_end);
#else
printf ("Proc_Segment PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -81,11 +159,12 @@ output (pid_t pid)
(unsigned long) data.proc_segment.start_code,
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack);
#endif
glibtop_get_proc_time (&data.proc_time, pid);
printf ("Proc_Time PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
printf ("Proc_Time PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -99,18 +178,32 @@ output (pid_t pid)
glibtop_get_proc_signal (&data.proc_signal, pid);
printf ("Proc_Signal PID %5u (0x%08lx): "
"%lu %lu %lu %lu\n", pid,
#if LIBGTOP_VERSION_CODE > 1001000
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lx %lx %lx %lx %lx %lx %lx %lx\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal [0],
(unsigned long) data.proc_signal.signal [1],
(unsigned long) data.proc_signal.blocked [0],
(unsigned long) data.proc_signal.blocked [1],
(unsigned long) data.proc_signal.sigignore [0],
(unsigned long) data.proc_signal.sigignore [1],
(unsigned long) data.proc_signal.sigcatch [0],
(unsigned long) data.proc_signal.sigcatch [1]);
#else
printf ("Proc_Signal PID %5d (0x%08lx): "
"%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore,
(unsigned long) data.proc_signal.sigcatch);
#endif
glibtop_get_proc_kernel (&data.proc_kernel, pid);
printf ("Proc_Kernel PID %5u (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", pid,
printf ("Proc_Kernel PID %5d (0x%08lx): "
"%lu %lu %lu %lu %lu 0x%lx 0x%lx 0x%lx (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -123,6 +216,97 @@ output (pid_t pid)
data.proc_kernel.wchan);
printf ("\n");
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
for (i = 0; i < data.proc_args.size; i++) {
if (args [i]) continue;
args [i] = '|';
}
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
args ? args : "");
glibtop_free (args);
printf ("\n");
#if HAVE_LIBGTOP_SMP
ncpu = glibtop_global_server->ncpu;
glibtop_get_proc_time (&data.proc_time, pid);
total = (unsigned long) data.proc_time.utime +
(unsigned long) data.proc_time.stime;
p_total = total ? (double) total : 1.0;
p_utime = (double) data.proc_time.utime * 100.0 / p_total;
p_stime = (double) data.proc_time.stime * 100.0 / p_total;
b_total = p_total / ncpu;
b_utime = (double) data.proc_time.utime / ncpu;
b_stime = (double) data.proc_time.stime / ncpu;
s_total = 0.0; s_utime = 0.0; s_stime = 0.0;
printf ("Proc_Time PID %5d (0x%08lx): %12lu %12lu %12lu\n", (int) pid,
(unsigned long) data.proc_time.flags, total,
(unsigned long) data.proc_time.utime,
(unsigned long) data.proc_time.stime);
for (i = 0; i < ncpu; i++) {
unsigned long this_total;
this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
(unsigned long) data.proc_time.xcpu_stime [i];
printf ("CPU %3d PID %5d (0x%08lx): %12lu %12lu %12lu\n", i,
(int) pid, (unsigned long) data.proc_time.flags, this_total,
(unsigned long) data.proc_time.xcpu_utime [i],
(unsigned long) data.proc_time.xcpu_stime [i]);
s_total += fabs (((double) this_total) - b_total);
s_utime += fabs (((double) data.proc_time.xcpu_utime [i]) - b_utime);
s_stime += fabs (((double) data.proc_time.xcpu_stime [i]) - b_stime);
}
printf ("\n");
printf ("Proc_Time PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", (int) pid,
(unsigned long) data.proc_time.flags, 100.0, p_utime, p_stime);
for (i = 0; i < ncpu; i++) {
double this_p_total, this_p_utime, this_p_stime;
unsigned long this_total;
this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
(unsigned long) data.proc_time.xcpu_stime [i];
this_p_total = (double) this_total * 100.0 / p_total;
this_p_utime = (double) data.proc_time.xcpu_utime [i] * 100.0 / p_total;
this_p_stime = (double) data.proc_time.xcpu_stime [i] * 100.0 / p_total;
printf ("CPU %3d PID %5d (0x%08lx): %12.3f %12.3f %12.3f\n", i,
(int) pid, (unsigned long) data.proc_time.flags,
this_p_total, this_p_utime, this_p_stime);
}
printf ("\n");
my_utime = (unsigned long) data.proc_time.utime ?
(double) data.proc_time.utime : 1.0;
my_stime = (unsigned long) data.proc_time.stime ?
(double) data.proc_time.stime : 1.0;
printf ("SPIN: %31s %12.3f %12.3f %12.3f\n", "", s_total * 100.0 / p_total,
s_utime * 100.0 / my_utime, s_stime * 100.0 / my_stime);
printf ("\n");
#endif
}
int
@@ -189,3 +373,6 @@ main (int argc, char *argv [])
exit (0);
}

126
examples/smp.c Normal file
View File

@@ -0,0 +1,126 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, September 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glibtop.h>
#include <glibtop/cpu.h>
#include <glibtop/xmalloc.h>
#include <math.h>
int
main (int argc, char *argv [])
{
glibtop_cpu cpu;
unsigned long frequency;
double total, user, nice, sys, idle;
double b_total, b_user, b_nice, b_sys, b_idle;
double s_total, s_user, s_nice, s_sys, s_idle;
char separator [BUFSIZ], buffer [BUFSIZ];
int ncpu, i;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
glibtop_get_cpu (&cpu);
ncpu = glibtop_global_server->ncpu ? glibtop_global_server->ncpu : 1;
frequency = (unsigned long) cpu.frequency;
total = ((unsigned long) cpu.total) ? ((double) cpu.total) : 1.0;
user = ((unsigned long) cpu.user) ? ((double) cpu.user) : 1.0;
nice = ((unsigned long) cpu.nice) ? ((double) cpu.nice) : 1.0;
sys = ((unsigned long) cpu.sys) ? ((double) cpu.sys) : 1.0;
idle = ((unsigned long) cpu.idle) ? ((double) cpu.idle) : 1.0;
s_total = s_user = s_nice = s_sys = s_idle = 0.0;
b_total = total / ncpu;
b_user = user / ncpu;
b_nice = nice / ncpu;
b_sys = sys / ncpu;
b_idle = idle / ncpu;
memset (separator, '-', 91);
separator [92] = '\0';
sprintf (buffer, _("Ticks (%d per second):"), frequency);
printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer,
_("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator);
printf (_("CPU (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n\n"),
(unsigned long) cpu.flags, total, user, nice, sys, idle);
for (i = 0; i < glibtop_global_server->ncpu; i++) {
printf (_("CPU %3d (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n"), i,
(unsigned long) cpu.flags,
(unsigned long) cpu.xcpu_total [i],
(unsigned long) cpu.xcpu_user [i],
(unsigned long) cpu.xcpu_nice [i],
(unsigned long) cpu.xcpu_sys [i],
(unsigned long) cpu.xcpu_idle [i]);
s_total += fabs (((double) cpu.xcpu_total [i]) - b_total);
s_user += fabs (((double) cpu.xcpu_user [i]) - b_user);
s_nice += fabs (((double) cpu.xcpu_nice [i]) - b_nice);
s_sys += fabs (((double) cpu.xcpu_sys [i]) - b_sys);
s_idle += fabs (((double) cpu.xcpu_idle [i]) - b_idle);
}
printf ("%s\n\n\n", separator);
printf ("%-26s %12s %12s %12s %12s %12s\n%s\n", _("Percent:"),
_("Total (%)"), _("User (%)"), _("Nice (%)"), _("Sys (%)"),
_("Idle (%)"), separator);
printf (_("CPU (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n\n"),
(unsigned long) cpu.flags, (double) total * 100.0 / total,
(double) user * 100.0 / total,
(double) nice * 100.0 / total,
(double) sys * 100.0 / total,
(double) idle * 100.0 / total);
for (i = 0; i < glibtop_global_server->ncpu; i++) {
double p_total, p_user, p_nice, p_sys, p_idle;
p_total = ((double) cpu.xcpu_total [i]) * 100.0 / total;
p_user = ((double) cpu.xcpu_user [i]) * 100.0 / user;
p_nice = ((double) cpu.xcpu_nice [i]) * 100.0 / nice;
p_sys = ((double) cpu.xcpu_sys [i]) * 100.0 / sys;
p_idle = ((double) cpu.xcpu_idle [i]) * 100.0 / idle;
printf (_("CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"),
i, (unsigned long) cpu.flags, p_total, p_user, p_nice,
p_sys, p_idle);
}
printf ("%s\n%-26s %12.3f %12.3f %12.3f %12.3f %12.3f\n\n", separator,
_("Spin:"), s_total * 100.0 / total, s_user * 100.0 / user,
s_nice * 100.0 / nice, s_sys * 100.0 / sys, s_idle * 100.0 / idle);
exit (0);
}

154
examples/sysdeps.c Normal file
View File

@@ -0,0 +1,154 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>
#include <glibtop/xmalloc.h>
#include <glibtop/parameter.h>
#ifndef PROFILE_COUNT
#define PROFILE_COUNT 1
#endif
int
main (int argc, char *argv [])
{
glibtop_sysdeps sysdeps;
unsigned method, count, port, i;
char buffer [BUFSIZ];
count = PROFILE_COUNT;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
printf ("Method = %d\n", method);
count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
buffer [count] = 0;
printf ("Command = '%s'\n", buffer);
count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
buffer [count] = 0;
glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
printf ("Host = '%s' - %u\n\n", buffer, port);
glibtop_init_r (&glibtop_global_server, 0, 0);
glibtop_get_sysdeps (&sysdeps);
#define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0)
printf ("Sysdeps (0x%08lx):\n\n"
"\tfeatures:\t\t0x%08lx\n\n"
#if LIBGTOP_VERSION_CODE > 1001000
"\tpointer_size:\t\t0x%08lx\n\n"
#endif
"\tcpu:\t\t%d\t0x%08lx\n"
"\tmem:\t\t%d\t0x%08lx\n"
"\tswap:\t\t%d\t0x%08lx\n\n"
"\tuptime:\t\t%d\t0x%08lx\n"
"\tloadavg:\t%d\t0x%08lx\n\n"
"\tshm_limits:\t%d\t0x%08lx\n"
"\tmsg_limits:\t%d\t0x%08lx\n"
"\tsem_limits:\t%d\t0x%08lx\n\n"
"\tproclist:\t%d\t0x%08lx\n\n"
"\tproc_state:\t%d\t0x%08lx\n"
"\tproc_uid:\t%d\t0x%08lx\n"
"\tproc_mem:\t%d\t0x%08lx\n"
"\tproc_time:\t%d\t0x%08lx\n"
"\tproc_signal:\t%d\t0x%08lx\n"
"\tproc_kernel:\t%d\t0x%08lx\n"
"\tproc_segment:\t%d\t0x%08lx\n\n"
"\tproc_args:\t%d\t0x%08lx\n"
"\tproc_map:\t%d\t0x%08lx\n\n"
"\tmountlist:\t%d\t0x%08lx\n"
"\tfsusage:\t%d\t0x%08lx\n\n"
"\tnetload:\t%d\t0x%08lx\n"
"\tppp:\t\t%d\t0x%08lx\n\n",
(unsigned long) sysdeps.flags,
(unsigned long) sysdeps.features,
#if LIBGTOP_VERSION_CODE > 1001000
(unsigned long) sysdeps.pointer_size,
#endif
FEATURE_CHECK(CPU),
(unsigned long) sysdeps.cpu,
FEATURE_CHECK(MEM),
(unsigned long) sysdeps.mem,
FEATURE_CHECK(SWAP),
(unsigned long) sysdeps.swap,
FEATURE_CHECK(UPTIME),
(unsigned long) sysdeps.uptime,
FEATURE_CHECK(LOADAVG),
(unsigned long) sysdeps.loadavg,
FEATURE_CHECK(SHM_LIMITS),
(unsigned long) sysdeps.shm_limits,
FEATURE_CHECK(MSG_LIMITS),
(unsigned long) sysdeps.msg_limits,
FEATURE_CHECK(SEM_LIMITS),
(unsigned long) sysdeps.sem_limits,
FEATURE_CHECK(PROCLIST),
(unsigned long) sysdeps.proclist,
FEATURE_CHECK(PROC_STATE),
(unsigned long) sysdeps.proc_state,
FEATURE_CHECK(PROC_UID),
(unsigned long) sysdeps.proc_uid,
FEATURE_CHECK(PROC_MEM),
(unsigned long) sysdeps.proc_mem,
FEATURE_CHECK(PROC_TIME),
(unsigned long) sysdeps.proc_time,
FEATURE_CHECK(PROC_SIGNAL),
(unsigned long) sysdeps.proc_signal,
FEATURE_CHECK(PROC_KERNEL),
(unsigned long) sysdeps.proc_kernel,
FEATURE_CHECK(PROC_SEGMENT),
(unsigned long) sysdeps.proc_segment,
FEATURE_CHECK(PROC_ARGS),
(unsigned long) sysdeps.proc_args,
FEATURE_CHECK(PROC_MAP),
(unsigned long) sysdeps.proc_map,
FEATURE_CHECK(MOUNTLIST),
(unsigned long) sysdeps.mountlist,
FEATURE_CHECK(FSUSAGE),
(unsigned long) sysdeps.fsusage,
FEATURE_CHECK(NETLOAD),
(unsigned long) sysdeps.netload,
FEATURE_CHECK(PPP),
(unsigned long) sysdeps.ppp);
glibtop_close ();
exit (0);
}

View File

@@ -1,23 +1,25 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>

360
examples/timings.c Normal file
View File

@@ -0,0 +1,360 @@
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glibtop.h>
#include <glibtop/open.h>
#include <glibtop/close.h>
#include <glibtop/xmalloc.h>
#include <glibtop/parameter.h>
#include <glibtop/union.h>
#include <glibtop/sysdeps.h>
#include <sys/times.h>
#include <sys/resource.h>
#ifndef PROFILE_COUNT
#define PROFILE_COUNT 100000L
#endif
#ifndef PROFILE_COUNT_EXPENSIVE
#define PROFILE_COUNT_EXPENSIVE 10000L
#endif
#define ELAPSED_UTIME ((unsigned long) elapsed_utime.tv_sec * 1000000 + (unsigned long) elapsed_utime.tv_usec)
#define ELAPSED_STIME ((unsigned long) elapsed_stime.tv_sec * 1000000 + (unsigned long) elapsed_stime.tv_usec)
#define libgtop_timeradd(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)
#define libgtop_timersub(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)
int
main (int argc, char *argv [])
{
glibtop_union data;
glibtop_sysdeps sysdeps;
unsigned c, count, port, i, *ptr;
struct rusage total_start, total_end;
struct rusage rusage_start, rusage_end;
struct timeval elapsed_utime, elapsed_stime;
char buffer [BUFSIZ];
pid_t pid, ppid;
char *args;
count = PROFILE_COUNT;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, GTOPLOCALEDIR);
textdomain (PACKAGE);
printf ("%-12s (%-10s): %7s - %9s - %9s\n",
"Feature", "Flags", "Count", "utime", "stime");
printf ("-------------------------------------------"
"---------------\n");
glibtop_init_r (&glibtop_global_server, 0, 0);
getrusage (RUSAGE_SELF, &total_start);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_cpu (&data.cpu);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("CPU (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.cpu.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
glibtop_get_mem (&data.mem);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Memory (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.mem.flags, PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++)
glibtop_get_swap (&data.swap);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Swap (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.swap.flags, PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_uptime (&data.uptime);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Uptime (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.uptime.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_loadavg (&data.loadavg);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Loadavg (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.loadavg.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
printf ("\n");
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT_EXPENSIVE; c++) {
ptr = glibtop_get_proclist (&data.proclist, 0, 0);
glibtop_free (ptr);
}
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proclist (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proclist.flags,
PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_UTIME / PROFILE_COUNT_EXPENSIVE,
(long double) ELAPSED_STIME / PROFILE_COUNT_EXPENSIVE);
pid = getpid ();
printf ("\n");
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_State (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_state.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Uid (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_uid.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Mem (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_mem.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Segment (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_segment.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Time (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_time.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Signal (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_signal.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, pid);
getrusage (RUSAGE_SELF, &rusage_end);
libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime);
printf ("Proc_Kernel (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_kernel.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
getrusage (RUSAGE_SELF, &total_end);
libgtop_timersub (&total_end.ru_utime, &total_start.ru_utime,
&elapsed_utime);
libgtop_timersub (&total_end.ru_stime, &total_start.ru_stime,
&elapsed_stime);
printf ("-------------------------------------------"
"---------------\n");
printf ("%-36s %9lu - %9lu\n\n", "TOTAL",
ELAPSED_UTIME, ELAPSED_STIME);
printf ("All timings are in clock ticks "
"(1000000 ticks per second).\n\n");
glibtop_close ();
exit (0);
}

View File

@@ -1,19 +1,22 @@
void|cpu|ulong(total,user,nice,sys,idle,frequency)
void|cpu|ulong(total,user,nice,sys,idle,frequency,xcpu_total[GLIBTOP_NCPU],xcpu_user[GLIBTOP_NCPU],xcpu_nice[GLIBTOP_NCPU],xcpu_sys[GLIBTOP_NCPU],xcpu_idle[GLIBTOP_NCPU],xcpu_flags)
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
void|swap|ulong(total,used,free,pagein,pageout)
void|uptime|double(uptime,idletime)
void|loadavg|double(loadavg[0],loadavg[1],loadavg[2]):ulong(nr_running,nr_tasks,last_pid)
void|uptime|double(uptime,idletime):ulong(boot_time)
void|loadavg|double(loadavg[3]):ulong(nr_running,nr_tasks,last_pid)
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
unsigned *|proclist|ulong(number,size,total)|long(which,arg)
void|proc_state|str(cmd):char(state):ulong(uid,gid)|pid_t(pid)
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t(pid)
void|proc_state|str(cmd):unsigned(state):ulong(uid,gid,ruid,rgid,has_cpu,processor,last_processor)|pid_t(pid)
void|proc_uid|long(uid,euid,gid,egid,suid,sgid,fsuid,fsgid,pid,ppid,pgrp,session,tty,tpgid,priority,nice,ngroups,groups[GLIBTOP_MAX_GROUPS])|pid_t(pid)
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t(pid)
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency)|pid_t(pid)
void|proc_signal|ulong(signal,blocked,sigignore,sigcatch)|pid_t(pid)
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency,xcpu_utime[GLIBTOP_NCPU],xcpu_stime[GLIBTOP_NCPU],xcpu_flags)|pid_t(pid)
void|proc_signal|ulong(signal[2],blocked[2],sigignore[2],sigcatch[2])|pid_t(pid)
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,nwchan):str(wchan)|pid_t(pid)
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_data,end_data,start_brk,end_brk,start_stack,start_mmap,arg_start,arg_end,env_start,env_end)|pid_t(pid)
char *|proc_args|ulong(size)|pid_t(pid):unsigned(max_len)
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
glibtop_mountentry *|@mountlist|ulong(number,size,total)|pid_t(all_fs)
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
void|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string|interface
void|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)

View File

@@ -1,28 +1,35 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_H__
#define __GLIBTOP_H__
#ifndef _IN_LIBGTOP
#include <glibtop-config.h>
#endif
#include <glibtop/global.h>
#include <glibtop/limits.h>
#include <glibtop_server.h>
#include <glibtop/types.h>
@@ -31,10 +38,6 @@
#include <glibtop_machine.h>
#endif
#ifndef GLIBTOP_MOUNTENTRY_LEN
#define GLIBTOP_MOUNTENTRY_LEN 79
#endif
typedef struct _glibtop glibtop;
#include <glibtop/sysdeps.h>
@@ -50,6 +53,7 @@ struct _glibtop
int input [2]; /* Pipe client <- server */
int output [2]; /* Pipe client -> server */
int socket; /* Accepted connection of a socket */
int ncpu; /* Number of CPUs, zero if single-processor */
unsigned long os_version_code; /* Version code of the operating system */
const char *name; /* Program name for error messages */
const char *server_command; /* Command used to invoke server */
@@ -60,6 +64,7 @@ struct _glibtop
unsigned long server_port; /* Port on which daemon is listening */
glibtop_sysdeps sysdeps; /* Detailed feature list */
glibtop_sysdeps required; /* Required feature list */
glibtop_sysdeps wanted; /* We only want this features */
pid_t pid; /* PID of the server */
};
@@ -71,14 +76,21 @@ extern const unsigned long glibtop_server_features;
#define glibtop_close() glibtop_close_r(glibtop_global_server);
extern glibtop *glibtop_init_r __P((glibtop **, unsigned long, unsigned));
extern glibtop *glibtop_init_s __P((glibtop **, unsigned long, unsigned));
glibtop *
glibtop_init_r (glibtop **server_ptr,
unsigned long features,
unsigned flags);
glibtop *
glibtop_init_s (glibtop **server_ptr,
unsigned long features,
unsigned flags);
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern void glibtop_boot_guile __P((void));
void glibtop_boot_guile (void);
#endif
@@ -86,7 +98,7 @@ extern void glibtop_boot_guile __P((void));
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern void glibtop_boot_guile_names __P((void));
void glibtop_boot_guile_names (void);
#ifndef GLIBTOP_NAMES
#define GLIBTOP_NAMES

View File

@@ -1,9 +0,0 @@
1998-07-29 Martin Baulig <martin@home-of-linux.org>
* dynamic.c, dynamic_names.c: New files.
* Makefile.am: New file. Creates `libgtop.so' and
`libnames.so' which will be installed in
`$(datadir)/guile/libgtop'; just do a
`(use-modules (libgtop libgtop) (libgtop names))' in
guile to use them.

View File

@@ -1,60 +0,0 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
CFLAGS = -Wall -W @CFLAGS@
sitedir = $(datadir)/guile/site
libgtopmoduledir = $(datadir)/guile/libgtop
libgtopmodule_LTLIBRARIES = libgtop.la libnames.la
libgtop_la_SOURCES = dynamic.c
libnames_la_SOURCES = dynamic_names.c
libgtop_la_LIBADD = ../sysdeps/guile/guile.lo \
../lib/init.lo \
../lib/open.lo \
../lib/close.lo \
../lib/command.lo \
../lib/read.lo \
../lib/read_data.lo \
../lib/write.lo \
../lib/lib.lo \
../lib/parameter.lo \
../lib/sysdeps.lo \
../sysdeps/common/error.lo \
../sysdeps/common/fsusage.lo \
../sysdeps/common/gnuslib.lo \
../sysdeps/common/mountlist.lo \
../sysdeps/common/xmalloc.lo \
../sysdeps/@sysdeps_dir@/close.lo \
../sysdeps/@sysdeps_dir@/proclist.lo \
../sysdeps/@sysdeps_dir@/sem_limits.lo \
../sysdeps/@sysdeps_dir@/cpu.lo \
../sysdeps/@sysdeps_dir@/procmem.lo \
../sysdeps/@sysdeps_dir@/shm_limits.lo \
../sysdeps/@sysdeps_dir@/loadavg.lo \
../sysdeps/@sysdeps_dir@/procsegment.lo \
../sysdeps/@sysdeps_dir@/siglist.lo \
../sysdeps/@sysdeps_dir@/mem.lo \
../sysdeps/@sysdeps_dir@/procsignal.lo \
../sysdeps/@sysdeps_dir@/swap.lo \
../sysdeps/@sysdeps_dir@/msg_limits.lo \
../sysdeps/@sysdeps_dir@/procstate.lo \
../sysdeps/@sysdeps_dir@/uptime.lo \
../sysdeps/@sysdeps_dir@/open.lo \
../sysdeps/@sysdeps_dir@/proctime.lo \
../sysdeps/@sysdeps_dir@/prockernel.lo \
../sysdeps/@sysdeps_dir@/procuid.lo \
../sysdeps/@sysdeps_dir@/procmap.lo
libnames_la_LIBADD = ../sysdeps/guile/names/guile-names.lo
EXTRA_DIST = features.awk
CLEANFILES = features.scm
features.scm: features.awk $(top_builddir)/config.h $(top_srcdir)/features.def
$(AWK) -f $(srcdir)/features.awk < $(top_srcdir)/features.def > tmp-t
mv tmp-t features.scm

View File

@@ -1,29 +0,0 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <glibtop.h>
#include <libguile/dynl.h>
void
scm_init_libgtop_libgtop_module (void)
{
scm_register_module_xxx ("libgtop libgtop", glibtop_boot_guile);
}

View File

@@ -1,29 +0,0 @@
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <glibtop.h>
#include <libguile/dynl.h>
void
scm_init_libgtop_names_module (void)
{
scm_register_module_xxx ("libgtop names", glibtop_boot_guile_names);
}

View File

@@ -1,61 +0,0 @@
BEGIN {
string = "";
names = "";
}
function output(line) {
split (line, line_fields, /\|/);
retval = line_fields[1];
feature = line_fields[2];
param_def = line_fields[4];
orig = feature; sub(/^@/,"",feature);
space = feature; gsub(/./," ",space);
if (string == "")
string = " '(";
else
string = string" ";
string = string"(\""feature"\" (\""retval"\"";
feature_nounder = feature;
sub(/_/, "-", feature_nounder);
if (names == "")
names = " '(";
else
names = names" ";
names = names"(\""feature"\" \""feature_nounder"\")\n";
nr_params = split (param_def, params, /:/);
for (param = 1; param <= nr_params; param++) {
list = params[param];
type = params[param];
sub(/\(.*/, "", type);
sub(/^\w+\(/, "", list); sub(/\)$/, "", list);
string = string" (\""type"\"";
count = split (list, fields, /,/);
for (field = 1; field <= count; field++) {
string = string" \""fields[field]"\"";
}
string = string")";
}
string = string"))\n";
}
/^[^#]/ { output($0) }
END {
print "(define libgtop-features";
print string" )";
print ")\n";
print "(define libgtop-feature-names";
print names" )";
print ")\n";
}

View File

@@ -1,440 +0,0 @@
;; $Id$
(define cpu-type '(("name" . "cpu")
("label" . "CPU Usage")
("fields" . (list
(("name" . "total")
("label" . "Total CPU Usage")
("type" . "unsigned long"))
(("name" . "user")
("type" . "unsigned long"))
(("name" . "nice")
("type" . "unsigned long"))
(("name" . "sys")
("type" . "unsigned long"))
(("name" . "idle")
("type" . "unsigned long"))
(("name" . "name")
("type" . "const char")
("pointer" . #t))
(("name" . "test"))
)
)
)
)
(define main-function
(lambda (definition)
(letrec ((default-type "unsigned long")
(struct-label-comments #t)
(struct-name-comments #f)
(default-name-tabs-first 3)
(default-name-tabs 4)
(default-type-tabs 2)
(default-comment-tabs 5)
(default-definition-tabs 3)
(default-definition-value-tabs 2)
(default-max-line-length 60)
;; set default values for unspecified fields
(check-field-definition
(lambda (fields)
(let ((newlist (list)))
(for-each
(lambda (field)
(if (not (assoc-ref field "type"))
(set! field (assoc-set! field "type" default-type)))
(if (assoc-ref field "label")
(set! field (assoc-set! field "has-label" #t))
(begin
(set! field (assoc-set! field "label" (assoc-ref field "name")))
(set! field (assoc-set! field "has-label" #f))
)
)
(set! newlist (append newlist (list field)))
)
(cdr fields))
(set-cdr! fields newlist)
)
)
)
;; number fields sequentially
(make-field-numbers
(lambda (fields)
(let ((pos 0) (newlist (list)))
(for-each
(lambda (field)
(set! field (assoc-set! field "number" pos))
(set! newlist (append newlist (list field)))
(set! pos (+ pos 1))
)
(cdr fields))
(set-cdr! fields newlist)
(set! definition (assoc-set! definition "max-fields" pos))
)
)
)
;; pad string with up to 'tabs' tabs
(tabify-string
(lambda (string tabs)
(let ((length (string-length string))
(tlength (* tabs 8)))
(if (> tlength length)
(let* ((diff (- tlength length))
(count (quotient (+ diff 7) 8)))
(string-append string
(make-string count #\tab))
)
(string-append string
#\space)
)
)
)
)
;; pad string with spaces
(spacify-string
(lambda (string tabs)
(let ((length (string-length string))
(tlength (* tabs 8)))
(if (> tlength length)
(string-append string
(make-string (- tlength length) #\space))
(string-append string
#\space)
)
)
)
)
;; creates comment string
(make-comment-string
(lambda (comment)
(if comment
(string "/* "
(spacify-string comment
default-comment-tabs)
" */")
(string)
)
)
)
;; create constant for entry (eg. GLIBTOP_CPU_TOTAL)
(entry-constant-name
(lambda (name)
(string-upcase! (string "GLIBTOP_"
(assoc-ref definition "name")
"_"
name
)
)
)
)
;; create text that is displayed as comment along with entry
(entry-comment-text
(lambda (name label)
(if label
(if struct-label-comments label #f)
(if struct-name-comments (entry-constant-name name) #f)
)
)
)
;; starts struct definition
(make-struct-definition-head
(lambda ()
(let* ((class (assoc-ref definition "name"))
)
(string "struct _glibtop_" class "\n"
"{\n"
)
)
)
)
;; terminates struct definition
(make-struct-definition-tail
(lambda ()
(string "};\n\n")
)
)
;; generate struct definition body
(make-struct-definition-body
(lambda (fields)
(letrec ((output (string))
(is-first-entry #t)
(current-type #f)
(current-name #f)
(current-label #f)
(current-pointer #f)
;; close entry (other = next entry is of other type)
(entry-end
(lambda (other)
(let ((old-first is-first-entry))
(set! is-first-entry other)
(if current-type
(string (tabify-string (string (string (if current-pointer "*" ""))
current-name
(string (if other ";" ","))
)
(if old-first
default-name-tabs-first
default-name-tabs
)
)
(make-comment-string (entry-comment-text
current-name current-label))
"\n")
(string)
)
)
)
)
;; start new entry
(entry-start
(lambda (name type)
(if current-type
(if (equal? current-type type)
(string (entry-end #f) "\t\t")
(string (entry-end #t) "\t"
(tabify-string type default-type-tabs)
)
)
(string "\t"
(tabify-string type default-type-tabs)
)
)
)
)
)
;; main function
(for-each
(lambda (field)
(let ((name (assoc-ref field "name"))
(type (assoc-ref field "type"))
(pointer (assoc-ref field "pointer"))
(label (if (assoc-ref field "has-label")
(assoc-ref field "label")
#f)
)
)
(set! output (string-append output
(string (entry-start name type))
)
)
;; save current data
(set! current-type type)
(set! current-name name)
(set! current-label label)
(set! current-pointer pointer)
)
)
(cdr fields))
;; close last entry
(string-append output (entry-end #t))
)
)
)
;; display complete struct definition
(make-struct-definition
(lambda (fields)
(string-append (make-struct-definition-head)
(make-struct-definition-body fields)
(make-struct-definition-tail)
)
)
)
;; make constant definition
(make-const-definition
(lambda (name value comment)
(let* ((nstring (string-upcase! (string "GLIBTOP_" name)))
(tabname (tabify-string nstring default-definition-tabs))
(tabvalue (if comment
(tabify-string (string value) default-definition-value-tabs)
(string value))
)
(ctext (make-comment-string comment))
(line (string "#define " tabname tabvalue ctext "\n"))
)
line)
)
)
;; creates constant definitions
(make-struct-constants
(lambda (fields)
(let ((class (assoc-ref definition "name"))
(output (string))
)
(for-each
(lambda (field)
(let* ((name (assoc-ref field "name"))
(number (assoc-ref field "number"))
(key (string class "_" name))
(value (number->string number))
(label (if (assoc-ref field "has-label")
(assoc-ref field "label")
#f)
)
(line (make-const-definition key
value
(entry-comment-text name label)
)
)
)
(set! output (string-append output line))
)
)
(cdr fields))
output)
)
)
;; creates definition of maximum constant
(make-struct-max-constant
(lambda ()
(let* ((class (assoc-ref definition "name"))
(max (assoc-ref definition "max-fields"))
)
(make-const-definition (string "MAX_" class)
(number->string max)
#f)
)
)
)
;; adds new list element to string, inserting newline if necessary
(add-to-string
(lambda (output line element separator indent max-length)
(let* ((slen (string-length line))
(elen (string-length element))
(tlen (+ slen elen))
(bsep (if separator
(string separator " ")
(string)
)
)
(nsep (string (if separator separator "") "\n"))
)
(if (and (> slen 0) (> tlen max-length))
(begin
(set! output (string-append output line nsep))
(set! line (string indent element))
)
(set! line (string-append line bsep element))
)
(list output line)
)
)
)
;; create general list definition
(make-general-list-definition
(lambda (fields name symbol line-length make-element-string)
(letrec ((class (assoc-ref definition "name"))
(make-general-list-definition-head
(lambda ()
(string "const char *"
"glibtop_"
symbol
"_"
class
" "
"[GLIBTOP_MAX_"
(string-upcase! (string class))
"] = \n{ "
)
)
)
(make-general-list-definition-tail
(lambda ()
(string "\n};\n")
)
)
(make-general-list-definition-body
(lambda ()
(let* ((first #t) (output (string)) (line (string)))
(for-each
(lambda (field)
(let* ((element (assoc-ref field name))
(olist (add-to-string output line
(make-element-string element)
(if first #f ",")
" "
line-length))
)
(set! output (car olist))
(set! line (car (cdr olist)))
(set! first #f)
)
)
(cdr fields))
(set! output (string-append output line))
output)
)
)
)
;; main function
(string-append (make-general-list-definition-head)
(make-general-list-definition-body)
(make-general-list-definition-tail)
)
)
)
)
;; create name list definition
(make-name-list-definition
(lambda (fields)
(make-general-list-definition fields
"name"
"names"
default-max-line-length
(lambda (x)
(string #\" x #\")
)
)
)
)
;; create label list definition
(make-label-list-definition
(lambda (fields)
(make-general-list-definition fields
"label"
"labels"
0
(lambda (x)
(string "gettext_noop (" #\" x #\" ")")
)
)
)
)
;; create description list definition
(make-description-list-definition
(lambda (fields)
(make-general-list-definition fields
"description"
"descriptions"
default-max-line-length
(lambda (x)
(if x
(string "gettext_noop (" #\" x #\" ")")
(string "NULL")
)
)
)
)
)
)
;; start of main function
(let ((fielddef (assoc-ref definition "fields")))
(display fielddef) (newline) (newline)
(check-field-definition fielddef)
(make-field-numbers fielddef)
(display fielddef) (newline) (newline)
(display (make-struct-definition fielddef))
(display (make-struct-constants fielddef)) (newline)
(display (make-struct-max-constant)) (newline) (newline)
(display (make-name-list-definition fielddef)) (newline)
(display (make-label-list-definition fielddef)) (newline)
(display (make-description-list-definition fielddef)) (newline)
)
)
)
)
(begin
(main-function cpu-type)
(newline)
)

View File

@@ -1,346 +0,0 @@
;; $Id$
(load "features.scm")
(define sysdeps-list '())
(define type-names '("void"
"int64_t" "u_int64_t" "double"
"int" "char" "const char *"))
(define make-sysdeps-list
(lambda ()
(letrec ((names (cdr (glibtop-names-sysdeps)))
(labels (cdr (glibtop-labels-sysdeps)))
(descriptions (cdr (glibtop-descriptions-sysdeps)))
)
(for-each (lambda (feature)
(let* ((label (car labels))
(description (car descriptions))
(list '())
)
(set! labels (cdr labels))
(set! descriptions (cdr descriptions))
(set! list (assoc-set! list 'name feature))
(set! list (assoc-set! list 'label label))
(set! list (assoc-set! list 'description description))
(set! sysdeps-list (assoc-set! sysdeps-list feature list))
)
)
names)
)
)
)
(define make-function-reference
(lambda (feature)
(let* ((names (eval-string (string "(glibtop-names-" feature ")")))
(types (eval-string (string "(glibtop-types-" feature ")")))
(labels (eval-string (string "(glibtop-labels-" feature ")")))
(sysdeps (assoc-ref sysdeps-list feature))
(retval (car (car (assoc-ref libgtop-features feature))))
(name (assoc-ref sysdeps 'name))
(label (assoc-ref sysdeps 'label))
(description (assoc-ref sysdeps 'description))
(descriptions (eval-string (string "(glibtop-descriptions-" feature ")")))
(feature_nounder (car (assoc-ref libgtop-feature-names feature)))
(decl-list '()) (field-list '())
(synopsis-start-string
(string "<para>Automatically generated function synopsis:\n\n"))
(section-string
(string "<sect1>\n"
"<title><function>glibtop_get_" feature "()</function> - "
label "</title>\n\n")
)
(description-string
(string "<para>\nAutomatically generated description:\n\n"
"<blockquote>\n<literallayout>\n"
description "\n"
"</literallayout>\n</blockquote>\n\n")
)
(definition-start-string
(string "<para>Automatically generated declaration of "
"<structname>_glibtop_" feature "</structname>:\n\n")
)
(param-description-start-string
(string "<para>Automatically generated descriptions of "
"<structname>_glibtop_" feature "</structname>:\n\n")
)
(funcsynopsisinfo-string
(string "<funcsynopsisinfo>\n"
"#include &lt;glibtop.h&gt;\n"
"#include &lt;glibtop/" feature ".h&gt;"
"</funcsynopsisinfo>")
)
(funcdef-string
(string "<funcdef>" retval " "
"<function>glibtop_get_" feature "_l</function>"
"</funcdef>\n")
)
(paramdef-string
(lambda ()
(let ((start (string "<paramdef>glibtop *<parameter>"
"server</parameter>, glibtop_"
feature " *<parameter>" feature
"</parameter>")
)
(param_string (string))
(end (string "\n</paramdef>"))
(param_lists
(cdr (car (assoc-ref libgtop-features feature))))
)
(for-each
(lambda (x)
(let ((type (car x))
(params (cdr x))
)
(for-each
(lambda (param)
(set! param_string (string param_string
", " type
" <parameter>"
param
"</parameter>"
)
)
)
params)
)
)
param_lists)
(string start param_string end))
)
)
(funcdef-noserver-string
(string "<funcdef>" retval " "
"<function>glibtop_get_" feature "</function>"
"</funcdef>\n")
)
(paramdef-noserver-string
(string "<paramdef>glibtop_" feature " *"
"<parameter>" feature "</parameter>\n"
"</paramdef>")
)
(field-name-constant
(lambda (name field)
(string "GLIBTOP_"
(string-upcase! (string name))
"_"
(string-upcase! (string field)))
)
)
(make-struct-name
(lambda (type)
(string "glibtop_" (assoc-ref type "name"))
)
)
(tab-pad-string
(lambda (string tabs)
(let* ((slength (string-length string))
(tlength (* tabs 8)))
(string-append string
(make-string
(if (> tlength slength)
(- tlength slength)
1
)
#\space))
)
)
)
(make-field-list
(lambda (name type fields)
(let* ((output (string)) (pos 1))
(map
(lambda (x)
(let* ((sep (if (= pos (length fields)) ";" ","))
(start (if (= pos 1)
(string "\t"
(tab-pad-string (string type) 2))
(string "\t\t"))
)
(comment (string (if (= pos 1) "" "\t") "/* "
(tab-pad-string
(field-name-constant name (car x)) 4)
" */"))
(field (tab-pad-string
(string-append (string (car x)) sep) 2))
)
(set! pos (+ pos 1))
(string-append start field comment "\n")
)
)
fields)
)
)
)
(init-field-list
(lambda ()
(let* ((old-type #f)
(type-list types)
(new-type #f)
(fields (list))
)
(for-each
(lambda (x)
(set! new-type (car type-list))
(set! type-list (cdr type-list))
(set! new-type (list-ref type-names new-type))
(if (equal? old-type new-type)
(set-car! fields
(append (list new-type)
(cdr (car fields))
(list (list x))
)
)
(if (equal? old-type #f)
(set! fields (list (list new-type (list x))))
(set! fields (append (list (list new-type (list x))) fields))
)
)
(set! old-type new-type)
)
names)
fields)
)
)
(make-struct-body
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (assoc-ref type "fields"))
(output (string))
)
(for-each
(lambda (y)
(for-each
(lambda (z)
(set! output (string-append output z))
)
y)
)
(map
(lambda (x) (make-field-list name (car x) (cdr x)))
data)
)
output)
)
)
(make-struct
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (assoc-ref type "fields"))
(output (string-append
(tab-pad-string
(string "typedef struct _glibtop_" name)
5)
(string "glibtop_" name ";\n\n"
"struct _glibtop_" name "\n{\n\t"
"u_int64_t\tflags;\n")
)
)
)
(string-append output (make-struct-body type) "};\n")
)
)
)
(make-param-description
(lambda ()
(let* ((label-list labels)
(description-list descriptions)
(output (string))
)
(for-each
(lambda (name)
(let* ((label (car label-list))
(description (car description-list))
)
(set! label-list (cdr label-list))
(set! description-list (cdr description-list))
(set! output
(string-append output
(string "<varlistentry>\n"
"<term><parameter>"
name
"</parameter></term>\n\n"
"<listitem>\n<para>\n"
description "\n\n")
)
)
)
)
names)
output)
)
)
)
(set! decl-list (assoc-set! decl-list "name" name))
(set! decl-list (assoc-set! decl-list "label" label))
(set! decl-list (assoc-set! decl-list "fields" (init-field-list)))
(string-append section-string
description-string
synopsis-start-string
(string "<blockquote>\n<funcsynopsis>\n")
funcsynopsisinfo-string
funcdef-noserver-string
paramdef-noserver-string
(string "</funcsynopsis>\n")
(string "<funcsynopsis>\n")
funcdef-string
(paramdef-string)
(string "</funcsynopsis>\n</blockquote>\n")
definition-start-string
(string "<blockquote>\n<literallayout>\n")
(make-struct decl-list)
(string "</literallayout>\n</blockquote>\n")
param-description-start-string
"<variablelist>\n\n"
(make-param-description)
"</variablelist>\n\n"
"&include-" feature_nounder ".sgml;\n\n"
)
)
)
)
;; <sect2 id="glibtop-get-cpu">
;; <title><function>glibtop_get_cpu()</function> - get CPU usage</title>
;;
;; <funcsynopsis>
;; <funcsynopsisinfo>
;; #include &lt;glibtop.h>
;; #include &lt;glibtop/cpu.h></funcsynopsisinfo>
;; <funcdef>void <function>glibtop_get_cpu</function></funcdef>
;; <paramdef>glibtop *<parameter>server</parameter>, glibtop_cpu *<parameter>cpu_usage</parameter>
;; </paramdef></funcsynopsis>
(begin
(make-sysdeps-list)
(for-each (lambda (x)
(display (make-function-reference x))
)
(cdr (glibtop-names-sysdeps)))
)

View File

@@ -1,195 +0,0 @@
(define cpu-type '(("name" . "cpu")
("label" . "CPU Usage")
("fields" . (("unsigned long" ("total" "Total CPU Usage")
("user") ("nice") ("sys") ("idle"))
("const char" ("name"))
)
)
)
)
;; computes constant for struct field (eg. GLIBTOP_CPU_TOTAL)
(define field-name-constant
(lambda (name field)
(string "GLIBTOP_"
(string-upcase! (string name))
"_"
(string-upcase! (string field)))
)
)
;; computes structure name (eg. glibtop_cpu)
(define make-struct-name
(lambda (type)
(string "glibtop_" (assoc-ref type "name"))
)
)
(define tab-pad-string
(lambda (string tabs)
(string-append string (make-string (- (* tabs 8) (string-length string)) #\space))
)
)
(define make-field-list
(lambda (name type fields)
(let* ((output (string)) (pos 1))
(map
(lambda (x)
(let* ((sep (if (= pos (length fields)) ";" ","))
(start (if (= pos 1)
(string "\t"
(tab-pad-string (string type) 2))
(string "\t\t"))
)
(comment (string (if (= pos 1) "" "\t") "/* "
(tab-pad-string (field-name-constant name (car x)) 3)
" */"))
(field (tab-pad-string (string-append (string (car x)) sep) 2))
)
(set! pos (+ pos 1))
(string-append start field comment "\n")
)
)
fields)
)
)
)
(define make-struct-body
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (assoc-ref type "fields"))
(output (string))
)
(for-each
(lambda (y)
(for-each
(lambda (z)
(set! output (string-append output z))
)
y)
)
(map
(lambda (x) (make-field-list name (car x) (cdr x)))
data)
)
output)
)
)
(define make-struct
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (assoc-ref type "fields"))
(output (string-append
(tab-pad-string
(string "typedef struct _glibtop_" name)
5)
(string "glibtop_" name ";\n\n"
"struct glibtop_" name "\n{\n\t"
"unsigned long\tflags;\n")
)
)
)
(string-append output (make-struct-body type) "};\n")
)
)
)
(define make-field-name-list
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (assoc-ref type "fields"))
(return (list))
)
(map
(lambda (x)
(map
(lambda (y) (set! return (append return (list (car y)))))
(cdr x)
)
)
data)
return)
)
)
(define make-field-constants
(lambda (type)
(let* ((name (assoc-ref type "name"))
(data (make-field-name-list type))
(output (string
(tab-pad-string
(string "#define GLIBTOP_MAX_"
(string-upcase! (string name))
) 5)
(number->string (length data))
"\n\n"
)
)
(pos 0)
)
(for-each
(lambda (x)
(set! output (string-append output (string
(tab-pad-string
(string "#define GLIBTOP_"
(string-upcase! (string name))
"_"
(string-upcase! (string x))
) 5)
(number->string pos)
"\n"
)
)
)
(set! pos (+ pos 1))
)
data)
output)
)
)
(define make-extern-defs
(lambda (type)
(let* ((name (assoc-ref type "name"))
)
(string
(tab-pad-string (string "extern void glibtop_get_" name) 6)
"__P(glibtop *, glibtop_" name " *);\n\n"
"#ifdef HAVE_GUILE\n\n"
"/* You need to link with -lgtop_guile to get this stuff here. */\n\n"
(tab-pad-string (string "extern SCM glibtop_get_" name) 6)
"__P(void);\n\n"
"#endif /* HAVE_GUILE */\n\n"
"#ifdef GLIBTOP_GUILE_NAMES\n\n"
"/* You need to link with -lgtop_guile_names to get this stuff here. */\n\n"
(tab-pad-string (string "extern SCM glibtop_guile_names_" name) 6)
"__P(void);\n"
(tab-pad-string (string "extern SCM glibtop_guile_labels_" name) 6)
"__P(void);\n"
(tab-pad-string (string "extern SCM glibtop_guile_descriptions_" name) 6)
"__P(void);\n\n"
"#endif /* GLIBTOP_GUILE_NAMES */\n\n"
"#ifdef GLIBTOP_NAMES\n\n"
"/* You need to link with -lgtop_names to get this stuff here. */\n\n"
(tab-pad-string (string "extern const char *glibtop_names_" name) 6)
"[];\n"
(tab-pad-string (string "extern const char *glibtop_labels_" name) 6)
"[];\n"
(tab-pad-string (string "extern const char *glibtop_descriptions_" name) 6)
"[];\n\n"
"#endif /* GLIBTOP_NAMES */\n\n")
)
)
)
(begin
(display (make-field-constants cpu-type)) (newline)
(display (make-struct cpu-type)) (newline)
(display (make-extern-defs cpu-type)) (newline)
)

File diff suppressed because it is too large Load Diff

View File

@@ -7,4 +7,5 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
procsegment.h read.h sysdeps.h xmalloc.h global.h \
procsignal.h read_data.h union.h types.h gnuserv.h \
parameter.h mountlist.h fsusage.h procmap.h signal.h \
inodedb.h
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
limits.h

View File

@@ -1,36 +1,40 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_CLOSE_H__
#define __GLIBTOP_CLOSE_H__
#include <glibtop.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
extern void glibtop_close_r __P((glibtop *));
void glibtop_close_r (glibtop *server);
extern void glibtop_close_s __P((glibtop *));
extern void glibtop_close_p __P((glibtop *));
void glibtop_close_s (glibtop *server);
void glibtop_close_p (glibtop *server);
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_COMMAND_H__
#define __GLIBTOP_COMMAND_H__
@@ -26,7 +30,7 @@
#include <glibtop/sysdeps.h>
#include <glibtop/union.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_CMND_QUIT 0
#define GLIBTOP_CMND_SYSDEPS 1
@@ -48,12 +52,15 @@ __BEGIN_DECLS
#define GLIBTOP_CMND_PROC_SIGNAL 15
#define GLIBTOP_CMND_PROC_KERNEL 16
#define GLIBTOP_CMND_PROC_SEGMENT 17
#define GLIBTOP_CMND_PROC_MAP 18
#define GLIBTOP_CMND_PROC_ARGS 18
#define GLIBTOP_CMND_PROC_MAP 19
#define GLIBTOP_CMND_MOUNTLIST 19
#define GLIBTOP_CMND_FSUSAGE 20
#define GLIBTOP_CMND_MOUNTLIST 20
#define GLIBTOP_CMND_FSUSAGE 21
#define GLIBTOP_CMND_NETLOAD 22
#define GLIBTOP_CMND_PPP 23
#define GLIBTOP_MAX_CMND 21
#define GLIBTOP_MAX_CMND 24
#define _GLIBTOP_PARAM_SIZE 16
@@ -64,29 +71,34 @@ typedef union _glibtop_response_union glibtop_response_union;
struct _glibtop_command
{
u_int64_t command;
u_int64_t size, data_size;
char parameter [_GLIBTOP_PARAM_SIZE];
u_int64_t command;
u_int64_t size, data_size;
char parameter [_GLIBTOP_PARAM_SIZE];
};
union _glibtop_response_union
{
glibtop_union data;
glibtop_sysdeps sysdeps;
glibtop_union data;
glibtop_sysdeps sysdeps;
};
struct _glibtop_response
{
int64_t offset;
u_int64_t size, data_size;
glibtop_response_union u;
int64_t offset;
u_int64_t size, data_size;
glibtop_response_union u;
};
#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, void *, size_t, void *));
extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, void *, size_t, void *));
void *
glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
const void *send_buf, size_t recv_size, void *recv_buf);
__END_DECLS
void *
glibtop_call_s (glibtop *server, unsigned command, size_t send_size,
const void *send_buf, size_t recv_size, void *recv_buf);
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_CPU_H__
#define __GLIBTOP_CPU_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_CPU_TOTAL 0
#define GLIBTOP_CPU_USER 1
@@ -34,19 +38,32 @@ __BEGIN_DECLS
#define GLIBTOP_CPU_IDLE 4
#define GLIBTOP_CPU_FREQUENCY 5
#define GLIBTOP_MAX_CPU 6
#define GLIBTOP_XCPU_TOTAL 6
#define GLIBTOP_XCPU_USER 7
#define GLIBTOP_XCPU_NICE 8
#define GLIBTOP_XCPU_SYS 9
#define GLIBTOP_XCPU_IDLE 10
#define GLIBTOP_XCPU_FLAGS 11
#define GLIBTOP_MAX_CPU 12
typedef struct _glibtop_cpu glibtop_cpu;
struct _glibtop_cpu
{
u_int64_t flags,
total, /* GLIBTOP_CPU_TOTAL */
user, /* GLIBTOP_CPU_USER */
nice, /* GLIBTOP_CPU_NICE */
sys, /* GLIBTOP_CPU_SYS */
idle, /* GLIBTOP_CPU_IDLE */
frequency; /* GLIBTOP_CPU_FREQUENCY */
u_int64_t flags,
total, /* GLIBTOP_CPU_TOTAL */
user, /* GLIBTOP_CPU_USER */
nice, /* GLIBTOP_CPU_NICE */
sys, /* GLIBTOP_CPU_SYS */
idle, /* GLIBTOP_CPU_IDLE */
frequency, /* GLIBTOP_CPU_FREQUENCY */
xcpu_total [GLIBTOP_NCPU], /* GLIBTOP_XCPU_TOTAL */
xcpu_user [GLIBTOP_NCPU], /* GLIBTOP_XCPU_USER */
xcpu_nice [GLIBTOP_NCPU], /* GLIBTOP_XCPU_NICE */
xcpu_sys [GLIBTOP_NCPU], /* GLIBTOP_XCPU_SYS */
xcpu_idle [GLIBTOP_NCPU], /* GLIBTOP_XCPU_IDLE */
xcpu_flags; /* GLIBTOP_XCPU_FLAGS */
};
#define glibtop_get_cpu(cpu) glibtop_get_cpu_l(glibtop_global_server, cpu)
@@ -57,33 +74,14 @@ struct _glibtop_cpu
#define glibtop_get_cpu_r glibtop_get_cpu_s
#endif
extern void glibtop_get_cpu_l __P((glibtop *, glibtop_cpu *));
void glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf);
#if GLIBTOP_SUID_CPU
extern void glibtop_init_cpu_p __P((glibtop *));
extern void glibtop_get_cpu_p __P((glibtop *, glibtop_cpu *));
void glibtop_init_cpu_p (glibtop *server);
void glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf);
#else
extern void glibtop_init_cpu_s __P((glibtop *));
extern void glibtop_get_cpu_s __P((glibtop *, glibtop_cpu *));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_cpu __P((void));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_cpu __P((void));
extern SCM glibtop_guile_types_cpu __P((void));
extern SCM glibtop_guile_labels_cpu __P((void));
extern SCM glibtop_guile_descriptions_cpu __P((void));
void glibtop_init_cpu_s (glibtop *server);
void glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf);
#endif
#ifdef GLIBTOP_NAMES
@@ -97,6 +95,6 @@ extern const char *glibtop_descriptions_cpu [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,30 +1,82 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_ERROR_H__
#define __GLIBTOP_ERROR_H__
#include <glibtop.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
void glibtop_error_vr (glibtop *server, char *format, va_list args);
void glibtop_warn_vr (glibtop *server, char *format, va_list args);
void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args);
void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args);
static void
glibtop_error_r (glibtop *server, char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_error_vr (server, format, args);
va_end (args);
}
static void
glibtop_warn_r (glibtop *server, char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_warn_vr (server, format, args);
va_end (args);
}
static void
glibtop_error_io_r (glibtop *server, char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_error_io_vr (server, format, errno, args);
va_end (args);
}
static void
glibtop_warn_io_r (glibtop *server, char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_warn_io_vr (server, format, errno, args);
va_end (args);
}
#ifdef __GNUC__
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
#define glibtop_warn(p1, args...) glibtop_warn_r(glibtop_global_server , p1 , ## args)
@@ -32,12 +84,46 @@ __BEGIN_DECLS
#define glibtop_error_io(p1, args...) glibtop_error_io_r(glibtop_global_server , p1 , ## args)
#define glibtop_warn_io(p1, args...) glibtop_warn_io_r(glibtop_global_server , p1 , ## args)
extern void glibtop_error_r __P((glibtop *, char *, ...));
extern void glibtop_warn_r __P((glibtop *, char *, ...));
#else /* no __GNUC__ */
extern void glibtop_error_io_r __P((glibtop *, char *, ...));
extern void glibtop_warn_io_r __P((glibtop *, char *, ...));
static void
glibtop_error (char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_error_vr (glibtop_global_server, format, args);
va_end (args);
}
__END_DECLS
static void
glibtop_warn (char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_warn_vr (glibtop_global_server, format, args);
va_end (args);
}
static void
glibtop_error_io (char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_error_io_vr (glibtop_global_server, format, errno, args);
va_end (args);
}
static void
glibtop_warn_io (char *format, ...)
{
va_list args;
va_start (args, format);
glibtop_warn_io_vr (glibtop_global_server, format, errno, args);
va_end (args);
}
#endif /* no __GNUC__ */
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_FSUSAGE_H__
#define __GLIBTOP_FSUSAGE_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_FSUSAGE_BLOCKS 0
#define GLIBTOP_FSUSAGE_BFREE 1
@@ -39,40 +43,20 @@ typedef struct _glibtop_fsusage glibtop_fsusage;
struct _glibtop_fsusage
{
u_int64_t flags,
blocks, /* Total blocks. */
bfree, /* Free blocks available to superuser. */
bavail, /* Free blocks available to non-superuser. */
files, /* Total file nodes. */
ffree; /* Free file nodes. */
u_int64_t flags,
blocks, /* Total blocks. */
bfree, /* Free blocks available to superuser. */
bavail, /* Free blocks available to non-superuser. */
files, /* Total file nodes. */
ffree; /* Free file nodes. */
};
#define glibtop_get_fsusage(fsusage,disk) glibtop_get_fsusage_l(glibtop_global_server, fsusage, disk)
#define glibtop_get_fsusage_r glibtop_get_fsusage_s
extern void glibtop_get_fsusage_l __P((glibtop *, glibtop_fsusage *, const char *));
extern void glibtop_get_fsusage_s __P((glibtop *, glibtop_fsusage *, const char *));
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_fsusage __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_fsusage __P((void));
extern SCM glibtop_guile_types_fsusage __P((void));
extern SCM glibtop_guile_labels_fsusage __P((void));
extern SCM glibtop_guile_descriptions_fsusage __P((void));
#endif
void glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
void glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
#ifdef GLIBTOP_NAMES
@@ -85,6 +69,6 @@ extern const char *glibtop_descriptions_fsusage [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,55 +1,69 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_GLOBAL_H__
#define __GLIBTOP_GLOBAL_H__
#ifdef _IN_LIBGTOP
#include <config.h>
#endif
/* __BEGIN_DECLS should be used at the beginning of your declarations,
so that C++ compilers don't mangle their names. Use __END_DECLS at
the end of C declarations. */
/*
* All declarations are enclosed in BEGIN_LIBGTOP_DECLS and
* END_LIBGTOP_DECLS so that C++ compilers don't mangle their names.
*
*/
#undef __BEGIN_DECLS
#undef __END_DECLS
#undef BEGIN_LIBGTOP_DECLS
#undef END_LIBGTOP_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# define BEGIN_LIBGTOP_DECLS extern "C" {
# define END_LIBGTOP_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
# define BEGIN_LIBGTOP_DECLS /* empty */
# define END_LIBGTOP_DECLS /* empty */
#endif
/* __P is a macro used to wrap function prototypes, so that compilers
that don't understand ANSI C prototypes still work, and ANSI C
compilers can issue warnings about type mismatches. */
#ifdef _IN_LIBGTOP
#undef __P
#if defined (__STDC__) || defined (_AIX) \
|| (defined (__mips) && defined (_SYSTYPE_SVR4)) \
|| defined(WIN32) || defined(__cplusplus)
# define __P(protos) protos
#else
# define __P(protos) ()
#endif
/* Provide macros to feature the GCC function attribute.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_NORETURN \
__attribute__((noreturn))
#define G_GNUC_CONST \
__attribute__((const))
#define G_GNUC_UNUSED \
__attribute__((unused))
#else /* !__GNUC__ */
#define G_GNUC_NORETURN
#define G_GNUC_CONST
#define G_GNUC_UNUSED
#endif /* !__GNUC__ */
#endif /* _IN_LIBGTOP */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
@@ -62,6 +76,10 @@
# endif
#endif
#ifdef NEED_GNOMESUPPORT_H
#include <gnomesupport.h>
#endif
#ifdef WITHOUT_GUILE
#undef GLIBTOP_GUILE
#undef GLIBTOP_GUILE_NAMES
@@ -93,24 +111,34 @@
#endif
#include <string.h>
#ifdef _IN_LIBGTOP
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#endif /* _IN_LIBGTOP */
#include <signal.h>
#include <errno.h>
__BEGIN_DECLS
#ifdef _IN_LIBGTOP
BEGIN_LIBGTOP_DECLS
#ifndef _
#define _(String) gettext (String)
#define _(String) dgettext (PACKAGE, String)
#define N_(String) (String)
#endif
#ifndef HAVE_STRERROR
extern char *strerror __P((int));
char *strerror (int errno);
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif /* _IN_LIBGTOP */
#endif

View File

@@ -75,7 +75,9 @@ static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup a
* stuff related to supporting MIT-MAGIC-COOKIE-1
*/
#define MCOOKIE_SCREEN "42980" /* screen # to use as the gnuserv cookie */
#if 0
#define MCOOKIE_SCREEN "42980" /* screen # to use as the gnuserv cookie */
#endif
#define MCOOKIE_NAME "MAGIC-1" /* authentication protocol name */
#define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1" /* as needed by X */
@@ -151,8 +153,9 @@ static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup a
#define CONN_IPC 2
/* function declarations */
extern int glibtop_make_connection __P((const char *, int, int *));
int glibtop_make_connection (const char *hostarg, int portarg, int *s);
#ifdef INTERNET_DOMAIN_SOCKETS
extern long glibtop_internet_addr __P((const char *));
long glibtop_internet_addr (const char *host);
#endif

View File

@@ -1,21 +1,25 @@
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_INODEDB_H__
#define __GLIBTOP_INODEDB_H__
@@ -29,7 +33,7 @@
#define GLIBTOP_INODEDB_ALL 7
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
typedef struct _glibtop_inodedb glibtop_inodedb;
@@ -37,22 +41,29 @@ typedef struct _glibtop_inodedb_key glibtop_inodedb_key;
struct _glibtop_inodedb_key
{
u_int64_t device, inode;
u_int64_t device, inode;
};
struct _glibtop_inodedb
{
GDBM_FILE system_dbf, user_dbf;
GDBM_FILE system_dbf, user_dbf;
};
#define glibtop_inodedb_open(p1,p2) glibtop_inodedb_open_s(glibtop_global_server, p1, p2)
#define glibtop_inodedb_lookup(p1,p2,p3) glibtop_inodedb_lookup_s(glibtop_global_server, p1, p2, p3)
#define glibtop_inodedb_close(p1) glibtop_inodedb_close_s(glibtop_global_server)
extern glibtop_inodedb *glibtop_inodedb_open_s __P((glibtop *, unsigned, unsigned long));
extern const char *glibtop_inodedb_lookup_s __P((glibtop *, glibtop_inodedb *, u_int64_t, u_int64_t));
extern void glibtop_inodedb_close_s __P((glibtop *, glibtop_inodedb *));
glibtop_inodedb *
glibtop_inodedb_open_s (glibtop *server, unsigned databases, unsigned long cache_size);
__END_DECLS
const char *
glibtop_inodedb_lookup_s (glibtop *server,
glibtop_inodedb *inodedb,
u_int64_t device, u_int64_t inode);
void
glibtop_inodedb_close_s (glibtop *server, glibtop_inodedb *inodedb);
END_LIBGTOP_DECLS
#endif

44
include/glibtop/limits.h Normal file
View File

@@ -0,0 +1,44 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_LIMITS_H__
#define __GLIBTOP_LIMITS_H__
#include <glibtop/global.h>
BEGIN_LIBGTOP_DECLS
/* Nobody should really be using more than 64 processors. */
#define GLIBTOP_NCPU 64
/* Maximum number of process groups in glibtop_proc_uid. */
#define GLIBTOP_MAX_GROUPS 32
/* Maximum length of a mountpoint/device name in glibtop_mountlist. */
#define GLIBTOP_MOUNTENTRY_LEN 79
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_LOADAVG_H__
#define __GLIBTOP_LOADAVG_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_LOADAVG_LOADAVG 0
#define GLIBTOP_LOADAVG_NR_RUNNING 1
@@ -38,11 +42,11 @@ typedef struct _glibtop_loadavg glibtop_loadavg;
struct _glibtop_loadavg
{
u_int64_t flags;
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
u_int64_t nr_running, /* GLIBTOP_LOADAVG_NR_RUNNING */
nr_tasks, /* GLIBTOP_LOADAVG_NR_TASKS */
last_pid; /* GLIBTOP_LOADAVG_LAST_PID */
u_int64_t flags;
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
u_int64_t nr_running, /* GLIBTOP_LOADAVG_NR_RUNNING */
nr_tasks, /* GLIBTOP_LOADAVG_NR_TASKS */
last_pid; /* GLIBTOP_LOADAVG_LAST_PID */
};
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg_l(glibtop_global_server, loadavg)
@@ -53,33 +57,14 @@ struct _glibtop_loadavg
#define glibtop_get_loadavg_r glibtop_get_loadavg_s
#endif
extern void glibtop_get_loadavg_l __P((glibtop *, glibtop_loadavg *));
void glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf);
#if GLIBTOP_SUID_LOADAVG
extern void glibtop_init_loadavg_p __P((glibtop *));
extern void glibtop_get_loadavg_p __P((glibtop *, glibtop_loadavg *));
void glibtop_init_loadavg_p (glibtop *server);
void glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf);
#else
extern void glibtop_init_loadavg_s __P((glibtop *));
extern void glibtop_get_loadavg_s __P((glibtop *, glibtop_loadavg *));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_loadavg __P((void));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_loadavg __P((void));
extern SCM glibtop_guile_types_loadavg __P((void));
extern SCM glibtop_guile_labels_loadavg __P((void));
extern SCM glibtop_guile_descriptions_loadavg __P((void));
void glibtop_init_loadavg_s (glibtop *server);
void glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf);
#endif
#ifdef GLIBTOP_NAMES
@@ -93,6 +78,6 @@ extern const char *glibtop_descriptions_loadavg [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_MEM_H__
#define __GLIBTOP_MEM_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_MEM_TOTAL 0
#define GLIBTOP_MEM_USED 1
@@ -42,15 +46,15 @@ typedef struct _glibtop_mem glibtop_mem;
struct _glibtop_mem
{
u_int64_t flags,
total, /* GLIBTOP_MEM_TOTAL */
used, /* GLIBTOP_MEM_USED */
free, /* GLIBTOP_MEM_FREE */
shared, /* GLIBTOP_MEM_SHARED */
buffer, /* GLIBTOP_MEM_BUFFER */
cached, /* GLIBTOP_MEM_CACHED */
user, /* GLIBTOP_MEM_USER */
locked; /* GLIBTOP_MEM_LOCKED */
u_int64_t flags,
total, /* GLIBTOP_MEM_TOTAL */
used, /* GLIBTOP_MEM_USED */
free, /* GLIBTOP_MEM_FREE */
shared, /* GLIBTOP_MEM_SHARED */
buffer, /* GLIBTOP_MEM_BUFFER */
cached, /* GLIBTOP_MEM_CACHED */
user, /* GLIBTOP_MEM_USER */
locked; /* GLIBTOP_MEM_LOCKED */
};
#define glibtop_get_mem(mem) glibtop_get_mem_l(glibtop_global_server, mem)
@@ -61,33 +65,14 @@ struct _glibtop_mem
#define glibtop_get_mem_r glibtop_get_mem_s
#endif
extern void glibtop_get_mem_l __P((glibtop *, glibtop_mem *));
void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf);
#if GLIBTOP_SUID_MEM
extern void glibtop_init_mem_p __P((glibtop *));
extern void glibtop_get_mem_p __P((glibtop *, glibtop_mem *));
void glibtop_init_mem_p (glibtop *server);
void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf);
#else
extern void glibtop_init_mem_s __P((glibtop *));
extern void glibtop_get_mem_s __P((glibtop *, glibtop_mem *));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_mem __P((void));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_mem __P((void));
extern SCM glibtop_guile_types_mem __P((void));
extern SCM glibtop_guile_labels_mem __P((void));
extern SCM glibtop_guile_descriptions_mem __P((void));
void glibtop_init_mem_s (glibtop *server);
void glibtop_get_mem_s (glibtop *server, glibtop_mem *buf);
#endif
#ifdef GLIBTOP_NAMES
@@ -101,6 +86,6 @@ extern const char *glibtop_descriptions_mem [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_MOUNTLIST_H__
#define __GLIBTOP_MOUNTLIST_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_MOUNTLIST_NUMBER 0
#define GLIBTOP_MOUNTLIST_TOTAL 1
@@ -39,46 +43,29 @@ typedef struct _glibtop_mountlist glibtop_mountlist;
struct _glibtop_mountentry
{
u_int64_t dev;
char devname [GLIBTOP_MOUNTENTRY_LEN+1];
char mountdir [GLIBTOP_MOUNTENTRY_LEN+1];
char type [GLIBTOP_MOUNTENTRY_LEN+1];
u_int64_t dev;
char devname [GLIBTOP_MOUNTENTRY_LEN+1];
char mountdir [GLIBTOP_MOUNTENTRY_LEN+1];
char type [GLIBTOP_MOUNTENTRY_LEN+1];
};
struct _glibtop_mountlist
{
u_int64_t flags,
number, /* GLIBTOP_MOUNTLIST_NUMBER */
total, /* GLIBTOP_MOUNTLIST_TOTAL */
size; /* GLIBTOP_MOUNTLIST_SIZE */
u_int64_t flags,
number, /* GLIBTOP_MOUNTLIST_NUMBER */
total, /* GLIBTOP_MOUNTLIST_TOTAL */
size; /* GLIBTOP_MOUNTLIST_SIZE */
};
#define glibtop_get_mountlist(mountlist,all_fs) glibtop_get_mountlist_l(glibtop_global_server, mountlist, all_fs)
#define glibtop_get_mountlist_r glibtop_get_mountlist_s
extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *, int));
glibtop_mountentry *
glibtop_get_mountlist_l (glibtop *server, glibtop_mountlist *buf, int all_fs);
extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *, int));
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_mountlist __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_mountlist __P((void));
extern SCM glibtop_guile_types_mountlist __P((void));
extern SCM glibtop_guile_labels_mountlist __P((void));
extern SCM glibtop_guile_descriptions_mountlist __P((void));
#endif
glibtop_mountentry *
glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs);
#ifdef GLIBTOP_NAMES
@@ -91,6 +78,6 @@ extern const char *glibtop_descriptions_mountlist [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_MSG_LIMITS_H__
#define __GLIBTOP_MSG_LIMITS_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_IPC_MSGPOOL 0
#define GLIBTOP_IPC_MSGMAP 1
@@ -41,14 +45,14 @@ typedef struct _glibtop_msg_limits glibtop_msg_limits;
struct _glibtop_msg_limits
{
u_int64_t flags,
msgpool, /* GLIBTOP_IPC_MSGPOOL */
msgmap, /* GLIBTOP_IPC_MSGMAP */
msgmax, /* GLIBTOP_IPC_MSGMAX */
msgmnb, /* GLIBTOP_IPC_MSGMNB */
msgmni, /* GLIBTOP_IPC_MSGMNI */
msgssz, /* GLIBTOP_IPC_MSGSSZ */
msgtql; /* GLIBTOP_IPC_MSGTQL */
u_int64_t flags,
msgpool, /* GLIBTOP_IPC_MSGPOOL */
msgmap, /* GLIBTOP_IPC_MSGMAP */
msgmax, /* GLIBTOP_IPC_MSGMAX */
msgmnb, /* GLIBTOP_IPC_MSGMNB */
msgmni, /* GLIBTOP_IPC_MSGMNI */
msgssz, /* GLIBTOP_IPC_MSGSSZ */
msgtql; /* GLIBTOP_IPC_MSGTQL */
};
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits_l(glibtop_global_server, msg)
@@ -59,33 +63,14 @@ struct _glibtop_msg_limits
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_s
#endif
extern void glibtop_get_msg_limits_l __P((glibtop *, glibtop_msg_limits *));
void glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf);
#if GLIBTOP_SUID_MSG_LIMITS
extern void glibtop_init_msg_limits_p __P((glibtop *));
extern void glibtop_get_msg_limits_p __P((glibtop *, glibtop_msg_limits *));
void glibtop_init_msg_limits_p (glibtop *server);
void glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf);
#else
extern void glibtop_init_msg_limits_s __P((glibtop *));
extern void glibtop_get_msg_limits_s __P((glibtop *, glibtop_msg_limits *));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_msg_limits __P((void));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_msg_limits __P((void));
extern SCM glibtop_guile_types_msg_limits __P((void));
extern SCM glibtop_guile_labels_msg_limits __P((void));
extern SCM glibtop_guile_descriptions_msg_limits __P((void));
void glibtop_init_msg_limits_s (glibtop *server);
void glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf);
#endif
#ifdef GLIBTOP_NAMES
@@ -99,6 +84,7 @@ extern const char *glibtop_descriptions_msg_limits [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

122
include/glibtop/netload.h Normal file
View File

@@ -0,0 +1,122 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_NETLOAD_H__
#define __GLIBTOP_NETLOAD_H__
#include <glibtop.h>
#include <glibtop/global.h>
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_NETLOAD_IF_FLAGS 0
#define GLIBTOP_NETLOAD_MTU 1
#define GLIBTOP_NETLOAD_SUBNET 2
#define GLIBTOP_NETLOAD_ADDRESS 3
#define GLIBTOP_NETLOAD_PACKETS_IN 4
#define GLIBTOP_NETLOAD_PACKETS_OUT 5
#define GLIBTOP_NETLOAD_PACKETS_TOTAL 6
#define GLIBTOP_NETLOAD_BYTES_IN 7
#define GLIBTOP_NETLOAD_BYTES_OUT 8
#define GLIBTOP_NETLOAD_BYTES_TOTAL 9
#define GLIBTOP_NETLOAD_ERRORS_IN 10
#define GLIBTOP_NETLOAD_ERRORS_OUT 11
#define GLIBTOP_NETLOAD_ERRORS_TOTAL 12
#define GLIBTOP_NETLOAD_COLLISIONS 13
#define GLIBTOP_MAX_NETLOAD 14
typedef struct _glibtop_netload glibtop_netload;
enum {
GLIBTOP_IF_FLAGS_UP = 1,
GLIBTOP_IF_FLAGS_BROADCAST,
GLIBTOP_IF_FLAGS_DEBUG,
GLIBTOP_IF_FLAGS_LOOPBACK,
GLIBTOP_IF_FLAGS_POINTOPOINT,
GLIBTOP_IF_FLAGS_RUNNING,
GLIBTOP_IF_FLAGS_NOARP,
GLIBTOP_IF_FLAGS_PROMISC,
GLIBTOP_IF_FLAGS_ALLMULTI,
GLIBTOP_IF_FLAGS_OACTIVE,
GLIBTOP_IF_FLAGS_SIMPLEX,
GLIBTOP_IF_FLAGS_LINK0,
GLIBTOP_IF_FLAGS_LINK1,
GLIBTOP_IF_FLAGS_LINK2,
GLIBTOP_IF_FLAGS_ALTPHYS,
GLIBTOP_IF_FLAGS_MULTICAST
};
struct _glibtop_netload
{
u_int64_t flags,
if_flags, /* GLIBTOP_NETLOAD_IF_FLAGS */
mtu, /* GLIBTOP_NETLOAD_MTU */
subnet, /* GLIBTOP_NETLOAD_SUBNET */
address, /* GLIBTOP_NETLOAD_ADDRESS */
packets_in, /* GLIBTOP_NETLOAD_PACKETS_IN */
packets_out, /* GLIBTOP_NETLOAD_PACKETS_OUT */
packets_total, /* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
bytes_in, /* GLIBTOP_NETLOAD_BYTES_IN */
bytes_out, /* GLIBTOP_NETLOAD_BYTES_OUT */
bytes_total, /* GLIBTOP_NETLOAD_BYTES_TOTAL */
errors_in, /* GLIBTOP_NETLOAD_ERRORS_IN */
errors_out, /* GLIBTOP_NETLOAD_ERRORS_OUT */
errors_total, /* GLIBTOP_NETLOAD_ERRORS_TOTAL */
collisions; /* GLIBTOP_NETLOAD_COLLISIONS */
};
#define glibtop_get_netload(netload,interface) glibtop_get_netload_l(glibtop_global_server, netload, interface)
#if GLIBTOP_SUID_NETLOAD
#define glibtop_get_netload_r glibtop_get_netload_p
#else
#define glibtop_get_netload_r glibtop_get_netload_s
#endif
void glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, const char *interface);
#if GLIBTOP_SUID_NETLOAD
void glibtop_init_netload_p (glibtop *server);
void glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, const char *interface);
#else
void glibtop_init_netload_s (glibtop *server);
void glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface);
#endif
#ifdef GLIBTOP_NAMES
/* You need to link with -lgtop_names to get this stuff here. */
extern const char *glibtop_names_netload [];
extern const unsigned glibtop_types_netload [];
extern const char *glibtop_labels_netload [];
extern const char *glibtop_descriptions_netload [];
#endif
END_LIBGTOP_DECLS
#endif

View File

@@ -1,21 +1,25 @@
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_OPEN_H__
#define __GLIBTOP_OPEN_H__
@@ -24,7 +28,7 @@
#include <glibtop/read.h>
#include <glibtop/error.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define _GLIBTOP_INIT_STATE_INIT 0x10000
#define _GLIBTOP_INIT_STATE_OPEN 0x20000
@@ -49,12 +53,23 @@ __BEGIN_DECLS
#define GLIBTOP_ERROR_METHOD_DEFAULT GLIBTOP_ERROR_METHOD_WARN_ONCE
extern void glibtop_open_l __P((glibtop *, const char *, const unsigned long, const unsigned));
void
glibtop_open_l (glibtop *server, const char *program_name,
const unsigned long features, const unsigned flags);
extern void glibtop_init_p __P((glibtop *, const unsigned long, const unsigned));
extern void glibtop_open_p __P((glibtop *, const char *, const unsigned long, const unsigned));
extern void glibtop_open_s __P((glibtop *, const char *, const unsigned long, const unsigned));
void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags);
__END_DECLS
void
glibtop_open_p (glibtop *server, const char *program_name,
const unsigned long features, const unsigned flags);
void
glibtop_open_s (glibtop *server, const char *program_name,
const unsigned long features, const unsigned flags);
END_LIBGTOP_DECLS
#endif

View File

@@ -1,21 +1,25 @@
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PARAMETER_H__
#define __GLIBTOP_PARAMETER_H__
@@ -23,7 +27,7 @@
#include <glibtop.h>
#include <glibtop/open.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PARAM_METHOD 1
#define GLIBTOP_PARAM_FEATURES 2
@@ -31,13 +35,19 @@ __BEGIN_DECLS
#define GLIBTOP_PARAM_HOST 4
#define GLIBTOP_PARAM_PORT 5
#define GLIBTOP_PARAM_ERROR_METHOD 6
#define GLIBTOP_PARAM_REQUIRED 7
#define glibtop_get_parameter(p1,p2,p3) glibtop_get_parameter_l(glibtop_global_server,p1,p2,p3)
#define glibtop_set_parameter(p1,p2,p3) glibtop_set_parameter_l(glibtop_global_server,p1,p2,p3)
extern size_t glibtop_get_parameter_l __P((glibtop *, const unsigned, void *, size_t));
extern void glibtop_set_parameter_l __P((glibtop *, const unsigned, const void *, size_t));
size_t
glibtop_get_parameter_l (glibtop *server, const unsigned parameter,
void *data_ptr, size_t data_size);
__END_DECLS
void
glibtop_set_parameter_l (glibtop *server, const unsigned parameter,
const void *data_ptr, size_t data_size);
END_LIBGTOP_DECLS
#endif

87
include/glibtop/ppp.h Normal file
View File

@@ -0,0 +1,87 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PPP_H__
#define __GLIBTOP_PPP_H__
#include <glibtop.h>
#include <glibtop/global.h>
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PPP_STATE 0
#define GLIBTOP_PPP_BYTES_IN 1
#define GLIBTOP_PPP_BYTES_OUT 2
#define GLIBTOP_MAX_PPP 3
typedef struct _glibtop_ppp glibtop_ppp;
enum {
GLIBTOP_PPP_STATE_UNKNOWN = 0,
GLIBTOP_PPP_STATE_HANGUP,
GLIBTOP_PPP_STATE_ONLINE
};
struct _glibtop_ppp
{
u_int64_t flags,
state, /* GLIBTOP_PPP_STATE */
bytes_in, /* GLIBTOP_PPP_BYTES_IN */
bytes_out; /* GLIBTOP_PPP_BYTES_OUT */
};
#define glibtop_get_ppp(ppp,device) glibtop_get_ppp_l(glibtop_global_server, ppp, device)
#if GLIBTOP_SUID_PPP
#define glibtop_get_ppp_r glibtop_get_ppp_p
#else
#define glibtop_get_ppp_r glibtop_get_ppp_s
#endif
void glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, unsigned short device);
#if GLIBTOP_SUID_PPP
void glibtop_init_ppp_p (glibtop *server);
void glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device);
#else
void glibtop_init_ppp_s (glibtop *server);
void glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device);
#endif
#ifdef GLIBTOP_NAMES
/* You need to link with -lgtop_names to get this stuff here. */
extern const char *glibtop_names_ppp [];
extern const unsigned glibtop_types_ppp [];
extern const char *glibtop_labels_ppp [];
extern const char *glibtop_descriptions_ppp [];
#endif
END_LIBGTOP_DECLS
#endif

View File

@@ -0,0 +1,85 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROC_ARGS_H__
#define __GLIBTOP_PROC_ARGS_H__
#include <glibtop.h>
#include <glibtop/global.h>
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_ARGS_SIZE 0
#define GLIBTOP_MAX_PROC_ARGS 1
typedef struct _glibtop_proc_args glibtop_proc_args;
struct _glibtop_proc_args
{
u_int64_t flags,
size; /* GLIBTOP_PROC_ARGS_SIZE */
};
#define glibtop_get_proc_args(proc_args,pid,max_len) glibtop_get_proc_args_l(glibtop_global_server, proc_args, pid, max_len)
#if GLIBTOP_SUID_PROC_ARGS
#define glibtop_get_proc_args_r glibtop_get_proc_args_p
#else
#define glibtop_get_proc_args_r glibtop_get_proc_args_s
#endif
char *
glibtop_get_proc_args_l (glibtop *server, glibtop_proc_args *buf,
pid_t pid, unsigned max_len);
#if GLIBTOP_SUID_PROC_ARGS
void glibtop_init_proc_args_p (glibtop *server);
char *
glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
pid_t pid, unsigned max_len);
#else
void glibtop_init_proc_args_s (glibtop *server);
char *
glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
pid_t pid, unsigned max_len);
#endif
#ifdef GLIBTOP_NAMES
/* You need to link with -lgtop_names to get this stuff here. */
extern const char *glibtop_names_proc_args [];
extern const unsigned glibtop_types_proc_args [];
extern const char *glibtop_labels_proc_args [];
extern const char *glibtop_descriptions_proc_args [];
#endif
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCKERNEL_H__
#define __GLIBTOP_PROCKERNEL_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_KERNEL_K_FLAGS 0
#define GLIBTOP_PROC_KERNEL_MIN_FLT 1
@@ -39,27 +43,38 @@ __BEGIN_DECLS
#define GLIBTOP_MAX_PROC_KERNEL 9
/* Constants for the `k_flags' field. */
#define GLIBTOP_KFLAGS_STARTING 1 /* being created */
#define GLIBTOP_KFLAGS_EXITING 2 /* getting shut down */
#define GLIBTOP_KFLAGS_PTRACED 4 /* set if ptrace (0) has
been called */
#define GLIBTOP_KFLAGS_TRACESYS 8 /* tracing system calls */
#define GLIBTOP_KFLAGS_FORKNOEXEC 16 /* forked but didn't exec */
#define GLIBTOP_KFLAGS_SUPERPRIV 32 /* used super-user privileges */
#define GLIBTOP_KFLAGS_DUMPEDCORE 64 /* dumped core */
#define GLIBTOP_KFLAGS_SIGNALED 128 /* killed by a signal */
typedef struct _glibtop_proc_kernel glibtop_proc_kernel;
/* Kernel stuff */
struct _glibtop_proc_kernel
{
u_int64_t flags;
u_int64_t k_flags, /* kernel flags for the process */
min_flt, /* number of minor page faults since
* process start */
maj_flt, /* number of major page faults since
* process start */
cmin_flt, /* cumulative min_flt of process and
* child processes */
cmaj_flt, /* cumulative maj_flt of process and
* child processes */
kstk_esp, /* kernel stack pointer */
kstk_eip, /* kernel stack pointer */
nwchan; /* address of kernel wait channel
* proc is sleeping in */
char wchan [40];
u_int64_t flags;
u_int64_t k_flags, /* kernel flags for the process */
min_flt, /* number of minor page faults since
* process start */
maj_flt, /* number of major page faults since
* process start */
cmin_flt, /* cumulative min_flt of process and
* child processes */
cmaj_flt, /* cumulative maj_flt of process and
* child processes */
kstk_esp, /* kernel stack pointer */
kstk_eip, /* kernel stack pointer */
nwchan; /* address of kernel wait channel
* proc is sleeping in */
char wchan [40];
};
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel_l(glibtop_global_server, p1, p2)
@@ -70,33 +85,14 @@ struct _glibtop_proc_kernel
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_s
#endif
extern void glibtop_get_proc_kernel_l __P((glibtop *, glibtop_proc_kernel *, pid_t));
void glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_KERNEL
extern void glibtop_init_proc_kernel_p __P((glibtop *));
extern void glibtop_get_proc_kernel_p __P((glibtop *, glibtop_proc_kernel *, pid_t));
void glibtop_init_proc_kernel_p (glibtop *server);
void glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
#else
extern void glibtop_init_proc_kernel_s __P((glibtop *));
extern void glibtop_get_proc_kernel_s __P((glibtop *, glibtop_proc_kernel *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_kernel __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_types_proc_kernel __P((void));
extern SCM glibtop_guile_names_proc_kernel __P((void));
extern SCM glibtop_guile_labels_proc_kernel __P((void));
extern SCM glibtop_guile_descriptions_proc_kernel __P((void));
void glibtop_init_proc_kernel_s (glibtop *server);
void glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -110,6 +106,6 @@ extern const char *glibtop_descriptions_proc_kernel [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCLIST_H__
#define __GLIBTOP_PROCLIST_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROCLIST_NUMBER 0
#define GLIBTOP_PROCLIST_TOTAL 1
@@ -54,10 +58,10 @@ typedef struct _glibtop_proclist glibtop_proclist;
struct _glibtop_proclist
{
u_int64_t flags,
number, /* GLIBTOP_PROCLIST_NUMBER */
total, /* GLIBTOP_PROCLIST_TOTAL */
size; /* GLIBTOP_PROCLIST_SIZE */
u_int64_t flags,
number, /* GLIBTOP_PROCLIST_NUMBER */
total, /* GLIBTOP_PROCLIST_TOTAL */
size; /* GLIBTOP_PROCLIST_SIZE */
};
#define glibtop_get_proclist(proclist,which,arg) glibtop_get_proclist_l(glibtop_global_server, proclist, which, arg)
@@ -68,33 +72,22 @@ struct _glibtop_proclist
#define glibtop_get_proclist_r glibtop_get_proclist_s
#endif
extern unsigned *glibtop_get_proclist_l __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
unsigned *
glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf,
int64_t which, int64_t arg);
#if GLIBTOP_SUID_PROCLIST
extern void glibtop_init_proclist_p __P((glibtop *));
extern unsigned *glibtop_get_proclist_p __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
void glibtop_init_proclist_p (glibtop *server);
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
int64_t which, int64_t arg);
#else
extern void glibtop_init_proclist_s __P((glibtop *));
extern unsigned *glibtop_get_proclist_s __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proclist __P((SCM, SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proclist __P((void));
extern SCM glibtop_guile_types_proclist __P((void));
extern SCM glibtop_guile_labels_proclist __P((void));
extern SCM glibtop_guile_descriptions_proclist __P((void));
void glibtop_init_proclist_s (glibtop *server);
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
int64_t which, int64_t arg);
#endif
#ifdef GLIBTOP_NAMES
@@ -108,6 +101,6 @@ extern const char *glibtop_descriptions_proclist [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROC_MAP_H__
#define __GLIBTOP_PROC_MAP_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_MAP_NUMBER 0
#define GLIBTOP_PROC_MAP_TOTAL 1
@@ -57,16 +61,16 @@ typedef struct _glibtop_proc_map glibtop_proc_map;
struct _glibtop_map_entry
{
u_int64_t flags, start, end, offset, perm, inode, device;
char filename [GLIBTOP_MAP_FILENAME_LEN+1];
u_int64_t flags, start, end, offset, perm, inode, device;
char filename [GLIBTOP_MAP_FILENAME_LEN+1];
};
struct _glibtop_proc_map
{
u_int64_t flags,
number, /* GLIBTOP_PROC_MAP_NUMBER */
total, /* GLIBTOP_PROC_MAP_TOTAL */
size; /* GLIBTOP_PROC_MAP_SIZE */
u_int64_t flags,
number, /* GLIBTOP_PROC_MAP_NUMBER */
total, /* GLIBTOP_PROC_MAP_TOTAL */
size; /* GLIBTOP_PROC_MAP_SIZE */
};
#define glibtop_get_proc_map(proc_map,pid) glibtop_get_proc_map_l(glibtop_global_server, proc_map, pid)
@@ -77,33 +81,19 @@ struct _glibtop_proc_map
#define glibtop_get_proc_map_r glibtop_get_proc_map_s
#endif
extern glibtop_map_entry *glibtop_get_proc_map_l __P((glibtop *, glibtop_proc_map *, pid_t));
glibtop_map_entry *
glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_MAP
extern void glibtop_init_proc_map_p __P((glibtop *));
extern glibtop_map_entry *glibtop_get_proc_map_p __P((glibtop *, glibtop_proc_map *, pid_t));
void glibtop_init_proc_map_p (glibtop *server);
glibtop_map_entry *
glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid);
#else
extern void glibtop_init_proc_map_s __P((glibtop *));
extern glibtop_map_entry *glibtop_get_proc_map_s __P((glibtop *, glibtop_proc_map *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_map __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_map __P((void));
extern SCM glibtop_guile_types_proc_map __P((void));
extern SCM glibtop_guile_labels_proc_map __P((void));
extern SCM glibtop_guile_descriptions_proc_map __P((void));
void glibtop_init_proc_map_s (glibtop *server);
glibtop_map_entry *
glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -117,6 +107,6 @@ extern const char *glibtop_descriptions_proc_map [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCMEM_H__
#define __GLIBTOP_PROCMEM_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_MEM_SIZE 0
#define GLIBTOP_PROC_MEM_VSIZE 1
@@ -42,15 +46,15 @@ typedef struct _glibtop_proc_mem glibtop_proc_mem;
struct _glibtop_proc_mem
{
u_int64_t flags,
size, /* total # of pages of memory */
vsize, /* number of pages of virtual memory ... */
resident, /* number of resident set
* (non-swapped) pages (4k) */
share, /* number of pages of shared (mmap'd) memory */
rss, /* resident set size */
rss_rlim; /* current limit (in bytes) of the rss
* of the process; usually 2,147,483,647 */
u_int64_t flags,
size, /* total # of pages of memory */
vsize, /* number of pages of virtual memory ... */
resident, /* number of resident set
* (non-swapped) pages (4k) */
share, /* number of pages of shared (mmap'd) memory */
rss, /* resident set size */
rss_rlim; /* current limit (in bytes) of the rss
* of the process; usually 2,147,483,647 */
};
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem_l(glibtop_global_server, p1, p2)
@@ -61,33 +65,14 @@ struct _glibtop_proc_mem
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_s
#endif
extern void glibtop_get_proc_mem_l __P((glibtop *, glibtop_proc_mem *, pid_t));
void glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_MEM
extern void glibtop_init_proc_mem_p __P((glibtop *));
extern void glibtop_get_proc_mem_p __P((glibtop *, glibtop_proc_mem *, pid_t));
void glibtop_init_proc_mem_p (glibtop *server);
void glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
#else
extern void glibtop_init_proc_mem_s __P((glibtop *));
extern void glibtop_get_proc_mem_s __P((glibtop *, glibtop_proc_mem *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_mem __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_types_proc_mem __P((void));
extern SCM glibtop_guile_names_proc_mem __P((void));
extern SCM glibtop_guile_labels_proc_mem __P((void));
extern SCM glibtop_guile_descriptions_proc_mem __P((void));
void glibtop_init_proc_mem_s (glibtop *server);
void glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -101,6 +86,6 @@ extern const char *glibtop_descriptions_proc_mem [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCSEGMENT_H__
#define __GLIBTOP_PROCSEGMENT_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_SEGMENT_TEXT_RSS 0
#define GLIBTOP_PROC_SEGMENT_SHLIB_RSS 1
@@ -34,9 +38,18 @@ __BEGIN_DECLS
#define GLIBTOP_PROC_SEGMENT_DIRTY_SIZE 4
#define GLIBTOP_PROC_SEGMENT_START_CODE 5
#define GLIBTOP_PROC_SEGMENT_END_CODE 6
#define GLIBTOP_PROC_SEGMENT_START_STACK 7
#define GLIBTOP_PROC_SEGMENT_START_DATA 7
#define GLIBTOP_PROC_SEGMENT_END_DATA 8
#define GLIBTOP_PROC_SEGMENT_START_BRK 9
#define GLIBTOP_PROC_SEGMENT_END_BRK 10
#define GLIBTOP_PROC_SEGMENT_START_STACK 11
#define GLIBTOP_PROC_SEGMENT_START_MMAP 12
#define GLIBTOP_PROC_SEGMENT_ARG_START 13
#define GLIBTOP_PROC_SEGMENT_ARG_END 14
#define GLIBTOP_PROC_SEGMENT_ENV_START 15
#define GLIBTOP_PROC_SEGMENT_ENV_END 16
#define GLIBTOP_MAX_PROC_SEGMENT 8
#define GLIBTOP_MAX_PROC_SEGMENT 17
typedef struct _glibtop_proc_segment glibtop_proc_segment;
@@ -44,16 +57,24 @@ typedef struct _glibtop_proc_segment glibtop_proc_segment;
struct _glibtop_proc_segment
{
u_int64_t flags,
text_rss, /* text resident set size */
shlib_rss, /* shared-lib resident set size */
data_rss, /* data resident set size */
stack_rss, /* stack resident set size */
dirty_size, /* size of dirty pages */
start_code,
/* address of beginning of code segment */
end_code, /* address of end of code segment */
start_stack; /* address of the bottom of stack segment */
u_int64_t flags,
text_rss, /* text resident set size */
shlib_rss, /* shared-lib resident set size */
data_rss, /* data resident set size */
stack_rss, /* stack resident set size */
dirty_size, /* size of dirty pages */
start_code, /* address of beginning of code segment */
end_code, /* address of end of code segment */
start_data, /* address of beginning of data segment */
end_data, /* address of end of data segment */
start_brk,
end_brk,
start_stack, /* address of the bottom of stack segment */
start_mmap,
arg_start,
arg_end,
env_start,
env_end;
};
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment_l(glibtop_global_server, p1, p2)
@@ -64,33 +85,14 @@ struct _glibtop_proc_segment
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_s
#endif
extern void glibtop_get_proc_segment_l __P((glibtop *, glibtop_proc_segment *, pid_t));
void glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_SEGMENT
extern void glibtop_init_proc_segment_p __P((glibtop *));
extern void glibtop_get_proc_segment_p __P((glibtop *, glibtop_proc_segment *, pid_t));
void glibtop_init_proc_segment_p (glibtop *server);
void glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
#else
extern void glibtop_init_proc_segment_s __P((glibtop *));
extern void glibtop_get_proc_segment_s __P((glibtop *, glibtop_proc_segment *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_segment __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_segment __P((void));
extern SCM glibtop_guile_types_proc_segment __P((void));
extern SCM glibtop_guile_labels_proc_segment __P((void));
extern SCM glibtop_guile_descriptions_proc_segment __P((void));
void glibtop_init_proc_segment_s (glibtop *server);
void glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -104,6 +106,6 @@ extern const char *glibtop_descriptions_proc_segment [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCSIGNAL_H__
#define __GLIBTOP_PROCSIGNAL_H__
@@ -25,7 +29,7 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_SIGNAL_SIGNAL 0
#define GLIBTOP_PROC_SIGNAL_BLOCKED 1
@@ -40,11 +44,11 @@ typedef struct _glibtop_proc_signal glibtop_proc_signal;
struct _glibtop_proc_signal
{
u_int64_t flags,
signal, /* mask of pending signals */
blocked, /* mask of blocked signals */
sigignore, /* mask of ignored signals */
sigcatch; /* mask of caught signals */
u_int64_t flags,
signal [2], /* mask of pending signals */
blocked [2], /* mask of blocked signals */
sigignore [2], /* mask of ignored signals */
sigcatch [2]; /* mask of caught signals */
};
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal_l(glibtop_global_server, p1, p2)
@@ -55,33 +59,14 @@ struct _glibtop_proc_signal
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_s
#endif
extern void glibtop_get_proc_signal_l __P((glibtop *, glibtop_proc_signal *, pid_t));
void glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_SIGNAL
extern void glibtop_init_proc_signal_p __P((glibtop *));
extern void glibtop_get_proc_signal_p __P((glibtop *, glibtop_proc_signal *, pid_t));
void glibtop_init_proc_signal_p (glibtop *server);
void glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
#else
extern void glibtop_init_proc_signal_s __P((glibtop *));
extern void glibtop_get_proc_signal_s __P((glibtop *, glibtop_proc_signal *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_signal __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_signal __P((void));
extern SCM glibtop_guile_types_proc_signal __P((void));
extern SCM glibtop_guile_labels_proc_signal __P((void));
extern SCM glibtop_guile_descriptions_proc_signal __P((void));
void glibtop_init_proc_signal_s (glibtop *server);
void glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -95,6 +80,6 @@ extern const char *glibtop_descriptions_proc_signal [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCSTATE_H__
#define __GLIBTOP_PROCSTATE_H__
@@ -25,14 +29,27 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_STATE_CMD 0
#define GLIBTOP_PROC_STATE_STATE 1
#define GLIBTOP_PROC_STATE_UID 2
#define GLIBTOP_PROC_STATE_GID 3
#define GLIBTOP_PROC_STATE_CMD 0
#define GLIBTOP_PROC_STATE_STATE 1
#define GLIBTOP_PROC_STATE_UID 2
#define GLIBTOP_PROC_STATE_GID 3
#define GLIBTOP_PROC_STATE_RUID 4
#define GLIBTOP_PROC_STATE_RGID 5
#define GLIBTOP_PROC_STATE_HAS_CPU 6
#define GLIBTOP_PROC_STATE_PROCESSOR 7
#define GLIBTOP_PROC_STATE_LAST_PROCESSOR 8
#define GLIBTOP_MAX_PROC_STATE 4
#define GLIBTOP_MAX_PROC_STATE 9
/* Constants for the `state' field. */
#define GLIBTOP_PROCESS_RUNNING 1
#define GLIBTOP_PROCESS_INTERRUPTIBLE 2
#define GLIBTOP_PROCESS_UNINTERRUPTIBLE 4
#define GLIBTOP_PROCESS_ZOMBIE 8
#define GLIBTOP_PROCESS_STOPPED 16
#define GLIBTOP_PROCESS_SWAPPING 32
typedef struct _glibtop_proc_state glibtop_proc_state;
@@ -40,18 +57,24 @@ typedef struct _glibtop_proc_state glibtop_proc_state;
struct _glibtop_proc_state
{
u_int64_t flags;
char cmd[40], /* basename of executable file in
u_int64_t flags;
char cmd[40]; /* basename of executable file in
* call to exec(2) */
state; /* single-char code for process state
* (S=sleeping) */
/* NOTE: when porting the library, TRY HARD to implement the
* following two fields. */
/* IMPORTANT NOTICE: For security reasons, it is extremely important
* only to set the flags value for those two
* fields if their values are corrent ! */
int uid, /* UID of process */
gid; /* GID of process */
unsigned state; /* process state */
/* NOTE: when porting the library, TRY HARD to implement the
* following two fields. */
/* IMPORTANT NOTICE: For security reasons, it is extremely important
* only to set the flags value for those two
* fields if their values are corrent ! */
int uid, /* effective UID of process */
gid, /* effective GID of process */
ruid, /* real UID of process */
rgid; /* real GID of process */
/* SMP values. */
int has_cpu,
processor,
last_processor;
};
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state_l(glibtop_global_server, p1, p2)
@@ -62,35 +85,16 @@ struct _glibtop_proc_state
#define glibtop_get_proc_state_r glibtop_get_proc_state_s
#endif
extern void glibtop_get_proc_state_l __P((glibtop *, glibtop_proc_state *, pid_t));
void glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_STATE
extern void glibtop_init_proc_state_p __P((glibtop *));
extern void glibtop_get_proc_state_p __P((glibtop *, glibtop_proc_state *, pid_t));
void glibtop_init_proc_state_p (glibtop *server);
void glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, pid_t pid);
#else
extern void glibtop_init_proc_state_s __P((glibtop *));
extern void glibtop_get_proc_state_s __P((glibtop *, glibtop_proc_state *, pid_t));
void glibtop_init_proc_state_s (glibtop *server);
void glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid);
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_state __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_state __P((void));
extern SCM glibtop_guile_types_proc_state __P((void));
extern SCM glibtop_guile_labels_proc_state __P((void));
extern SCM glibtop_guile_descriptions_proc_state __P((void));
#endif
#ifdef GLIBTOP_NAMES
/* You need to link with -lgtop_names to get this stuff here. */
@@ -102,6 +106,6 @@ extern const char *glibtop_descriptions_proc_state [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,31 +1,36 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCTIME_H__
#define __GLIBTOP_PROCTIME_H__
#include <glibtop.h>
#include <glibtop/cpu.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_TIME_START_TIME 0
#define GLIBTOP_PROC_TIME_RTIME 1
@@ -36,8 +41,11 @@ __BEGIN_DECLS
#define GLIBTOP_PROC_TIME_TIMEOUT 6
#define GLIBTOP_PROC_TIME_IT_REAL_VALUE 7
#define GLIBTOP_PROC_TIME_FREQUENCY 8
#define GLIBTOP_PROC_TIME_XCPU_UTIME 9
#define GLIBTOP_PROC_TIME_XCPU_STIME 10
#define GLIBTOP_PROC_TIME_XCPU_FLAGS 11
#define GLIBTOP_MAX_PROC_TIME 9
#define GLIBTOP_MAX_PROC_TIME 12
typedef struct _glibtop_proc_time glibtop_proc_time;
@@ -45,22 +53,25 @@ typedef struct _glibtop_proc_time glibtop_proc_time;
struct _glibtop_proc_time
{
u_int64_t flags,
start_time, /* start time of process --
* seconds since 1-1-70 */
rtime, /* real time accumulated by process */
utime, /* user-mode CPU time accumulated by process */
stime, /* kernel-mode CPU time accumulated by process */
cutime, /* cumulative utime of process and
* reaped children */
cstime, /* cumulative stime of process and
* reaped children */
timeout, /* The time (in jiffies) of the process's
* next timeout */
it_real_value, /* The time (in jiffies) before the
* next SIGALRM is sent to the process
* due to an interval timer. */
frequency; /* Tick frequency. */
u_int64_t flags,
start_time, /* start time of process --
* seconds since 1-1-70 */
rtime, /* real time accumulated by process */
utime, /* user-mode CPU time accumulated by process */
stime, /* kernel-mode CPU time accumulated by process */
cutime, /* cumulative utime of process and
* reaped children */
cstime, /* cumulative stime of process and
* reaped children */
timeout, /* The time (in jiffies) of the process's
* next timeout */
it_real_value, /* The time (in jiffies) before the
* next SIGALRM is sent to the process
* due to an interval timer. */
frequency, /* Tick frequency. */
xcpu_utime [GLIBTOP_NCPU], /* utime and stime for all CPUs on */
xcpu_stime [GLIBTOP_NCPU], /* SMP machines. */
xcpu_flags;
};
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time_l(glibtop_global_server, p1, p2)
@@ -71,33 +82,14 @@ struct _glibtop_proc_time
#define glibtop_get_proc_time_r glibtop_get_proc_time_s
#endif
extern void glibtop_get_proc_time_l __P((glibtop *, glibtop_proc_time *, pid_t));
void glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_TIME
extern void glibtop_init_proc_time_p __P((glibtop *));
extern void glibtop_get_proc_time_p __P((glibtop *, glibtop_proc_time *, pid_t));
void glibtop_init_proc_time_p (glibtop *server);
void glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid);
#else
extern void glibtop_init_proc_time_s __P((glibtop *));
extern void glibtop_get_proc_time_s __P((glibtop *, glibtop_proc_time *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_time __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_time __P((void));
extern SCM glibtop_guile_types_proc_time __P((void));
extern SCM glibtop_guile_labels_proc_time __P((void));
extern SCM glibtop_guile_descriptions_proc_time __P((void));
void glibtop_init_proc_time_s (glibtop *server);
void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -111,6 +103,6 @@ extern const char *glibtop_descriptions_proc_time [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_PROCUID_H__
#define __GLIBTOP_PROCUID_H__
@@ -25,22 +29,28 @@
#include <glibtop.h>
#include <glibtop/global.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_PROC_UID_UID 0
#define GLIBTOP_PROC_UID_EUID 1
#define GLIBTOP_PROC_UID_GID 2
#define GLIBTOP_PROC_UID_EGID 3
#define GLIBTOP_PROC_UID_PID 4
#define GLIBTOP_PROC_UID_PPID 5
#define GLIBTOP_PROC_UID_PGRP 6
#define GLIBTOP_PROC_UID_SESSION 7
#define GLIBTOP_PROC_UID_TTY 8
#define GLIBTOP_PROC_UID_TPGID 9
#define GLIBTOP_PROC_UID_PRIORITY 10
#define GLIBTOP_PROC_UID_NICE 11
#define GLIBTOP_PROC_UID_SUID 4
#define GLIBTOP_PROC_UID_SGID 5
#define GLIBTOP_PROC_UID_FSUID 6
#define GLIBTOP_PROC_UID_FSGID 7
#define GLIBTOP_PROC_UID_PID 8
#define GLIBTOP_PROC_UID_PPID 9
#define GLIBTOP_PROC_UID_PGRP 10
#define GLIBTOP_PROC_UID_SESSION 11
#define GLIBTOP_PROC_UID_TTY 12
#define GLIBTOP_PROC_UID_TPGID 13
#define GLIBTOP_PROC_UID_PRIORITY 14
#define GLIBTOP_PROC_UID_NICE 15
#define GLIBTOP_PROC_UID_NGROUPS 16
#define GLIBTOP_PROC_UID_GROUPS 17
#define GLIBTOP_MAX_PROC_UID 12
#define GLIBTOP_MAX_PROC_UID 18
typedef struct _glibtop_proc_uid glibtop_proc_uid;
@@ -48,19 +58,25 @@ typedef struct _glibtop_proc_uid glibtop_proc_uid;
struct _glibtop_proc_uid
{
u_int64_t flags;
int uid, /* user id */
euid, /* effective user id */
gid, /* group id */
egid, /* effective group id */
pid, /* process id */
ppid, /* pid of parent process */
pgrp, /* process group id */
session, /* session id */
tty, /* full device number of controlling terminal */
tpgid, /* terminal process group id */
priority, /* kernel scheduling priority */
nice; /* standard unix nice level of process */
u_int64_t flags;
int uid, /* user id */
euid, /* effective user id */
gid, /* group id */
egid, /* effective group id */
suid, /* saved user id */
sgid, /* saved group id */
fsuid, /* file system user id */
fsgid, /* file system group id */
pid, /* process id */
ppid, /* pid of parent process */
pgrp, /* process group id */
session, /* session id */
tty, /* full device number of controlling terminal */
tpgid, /* terminal process group id */
priority, /* kernel scheduling priority */
nice, /* standard unix nice level of process */
ngroups, /* number of additional process groups */
groups [GLIBTOP_MAX_GROUPS]; /* additional prcess groups */
};
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid_l(glibtop_global_server, p1, p2)
@@ -71,33 +87,14 @@ struct _glibtop_proc_uid
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_s
#endif
extern void glibtop_get_proc_uid_l __P((glibtop *, glibtop_proc_uid *, pid_t));
void glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_UID
extern void glibtop_init_proc_uid_p __P((glibtop *));
extern void glibtop_get_proc_uid_p __P((glibtop *, glibtop_proc_uid *, pid_t));
void glibtop_init_proc_uid_p (glibtop *server);
void glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
#else
extern void glibtop_init_proc_uid_s __P((glibtop *));
extern void glibtop_get_proc_uid_s __P((glibtop *, glibtop_proc_uid *, pid_t));
#endif
#ifdef GLIBTOP_GUILE
/* You need to link with -lgtop_guile to get this stuff here. */
extern SCM glibtop_guile_get_proc_uid __P((SCM));
#endif
#ifdef GLIBTOP_GUILE_NAMES
/* You need to link with -lgtop_guile_names to get this stuff here. */
extern SCM glibtop_guile_names_proc_uid __P((void));
extern SCM glibtop_guile_types_proc_uid __P((void));
extern SCM glibtop_guile_labels_proc_uid __P((void));
extern SCM glibtop_guile_descriptions_proc_uid __P((void));
void glibtop_init_proc_uid_s (glibtop *server);
void glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
#endif
#ifdef GLIBTOP_NAMES
@@ -111,6 +108,6 @@ extern const char *glibtop_descriptions_proc_uid [];
#endif
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_READ_H__
#define __GLIBTOP_READ_H__
@@ -25,13 +29,13 @@
#include <glibtop.h>
#include <glibtop/error.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define glibtop_read(p1, p2) glibtop_read(glibtop_global_server, p1, p2)
extern void glibtop_read_l __P((glibtop *, size_t, void *));
extern void glibtop_read_s __P((glibtop *, size_t, void *));
void glibtop_read_l (glibtop *server, size_t size, void *buf);
void glibtop_read_s (glibtop *server, size_t size, void *buf);
__END_DECLS
END_LIBGTOP_DECLS
#endif

View File

@@ -1,23 +1,27 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* $Id$ */
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the Gnome Top Library.
/* Copyright (C) 1998-99 Martin Baulig
This file is part of LibGTop 1.0.
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
The Gnome Top Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
The Gnome Top Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __GLIBTOP_READ_DATA_H__
#define __GLIBTOP_READ_DATA_H__
@@ -25,13 +29,13 @@
#include <glibtop.h>
#include <glibtop/error.h>
__BEGIN_DECLS
BEGIN_LIBGTOP_DECLS
#define glibtop_read_data() glibtop_read_data_r(glibtop_global_server)
extern void *glibtop_read_data_l __P((glibtop *));
extern void *glibtop_read_data_s __P((glibtop *));
void *glibtop_read_data_l (glibtop *server);
void *glibtop_read_data_s (glibtop *server);
__END_DECLS
END_LIBGTOP_DECLS
#endif

Some files were not shown because too many files have changed in this diff Show More