Compare commits

...

21 Commits

Author SHA1 Message Date
Sebastien Bacher
1991f7ed06 patch from Benot Dejean <bnet@ifrance.com> to fix libtop_mem.used and
2004-02-11  Sebastien Bacher  <seb128@debian.org>

        * sysdeps/linux/mem.c: (glibtop_get_mem_s): patch from
        Benot Dejean <bnet@ifrance.com> to fix libtop_mem.used
        and glibtop_mem.shared values (Closes: #129863).
2004-02-11 15:33:40 +00:00
Laurent Dhima
48226b861c Updated Albanian translation
* sq.po: Updated Albanian translation
2004-02-06 15:21:06 +00:00
Laurent Dhima
760e5c8791 Updated 2004-02-06 15:17:40 +00:00
Bastien Nocera
9968f74a05 Apply patch from Benoît Dejean <bnet@ifrance.com> to fix overflow issues
2003-12-23  Bastien Nocera  <hadess@hadess.net>

	* cpu.c: (glibtop_get_cpu_s):
	* glibtop_server.h:
	* loadavg.c: (glibtop_get_loadavg_s):
	* mem.c: (glibtop_get_mem_s):
	* netload.c: (glibtop_get_netload_s):
	* prockernel.c: (glibtop_get_proc_kernel_s):
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s):
	* procsignal.c: (glibtop_get_proc_signal_s):
	* proctime.c: (glibtop_get_proc_time_s):
	* procuid.c: (glibtop_get_proc_uid_s):
	* swap.c: (glibtop_get_swap_s): Apply patch from Benoît Dejean
	<bnet@ifrance.com> to fix overflow issues using strtol
	(Closes: #129881)
2003-12-23 10:43:41 +00:00
Bastien Nocera
84962b2301 Fix calculation of used memory, patch by Benoît Dejean,
2003-12-23  Bastien Nocera  <hadess@hadess.net>

	* mem.c: (glibtop_get_mem_s): Fix calculation of used memory,
	patch by Benoît Dejean, <bnet@ifrance.com> (Closes: #129863)
2003-12-23 10:39:35 +00:00
Bastien Nocera
d1a9dab750 2.0.8 (huh?)
2003-12-19  Bastien Nocera  <hadess@hadess.net>

	* configure.in: 2.0.8 (huh?)
2003-12-19 16:08:23 +00:00
Zygimantas Berucka
956fdf57de Added "lt" to ALL_LINGUAS. Added Lithuanian translation by Tomas Kuliavas.
2003-11-04  Zygimantas Berucka  <uid0@tuxfamily.org>

* configure.in: Added "lt" to ALL_LINGUAS.
* po/lt.po: Added Lithuanian translation by Tomas Kuliavas.
2003-11-04 17:05:42 +00:00
Jordi Mallach
82ae93ab70 Typo fixes by Jordi Mas <jmas@softcatala.org>. 2003-11-03 14:04:36 +00:00
Vincent van Adrighem
2159e530c5 Dutch translation updated by Jeroen van der Vegt.
2003-10-29   Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Dutch translation updated by Jeroen van der Vegt.
2003-10-29 15:17:21 +00:00
Kjartan Maraas
bec5e10bb1 Flush this 2003-10-25 17:17:40 +00:00
Christian Neumair
7bd1293665 Updated German translation. 2003-10-25 16:40:16 +00:00
Vincent van Adrighem
5edf277435 Dutch translation updated by Vincent van Adrighem.
2003-10-22   Vincent van Adrighem  <adrighem@gnome.org>

	* nl.po: Dutch translation updated by Vincent van Adrighem.
2003-10-21 22:27:31 +00:00
Christian Rose
3f307e8e30 Updated Swedish translation.
2003-10-22  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2003-10-21 22:09:35 +00:00
Bastien Nocera
b375457834 reverted string freeze breakage
2003-10-21  Bastien Nocera  <hadess@hadess.net>

	* lib/read.c: (glibtop_read_l):
	* lib/read_data.c: (glibtop_read_data_l):
	* lib/write.c: (glibtop_write_l):
	reverted string freeze breakage
2003-10-21 21:28:13 +00:00
Christian Neumair
79e8b914ed Updated German translation. 2003-10-21 12:09:36 +00:00
Christian Rose
faacbd7f8b Updated Swedish translation.
2003-10-21  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2003-10-21 11:11:31 +00:00
Bastien Nocera
dde57bee91 apply patch for ngettext support by Christian Neumair <chris@gnome-de.org>
2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* lib/read.c: (glibtop_read_l):
	* lib/read_data.c: (glibtop_read_data_l):
	* lib/write.c: (glibtop_write_l): apply patch for ngettext support
	by Christian Neumair <chris@gnome-de.org>
2003-10-20 21:32:20 +00:00
Bastien Nocera
08798f05f5 link to libgtop_suid_common-2.0.la (Closes: #107990)
2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* src/inodedb/Makefile.am: link to libgtop_suid_common-2.0.la
	(Closes: #107990)
2003-10-20 20:48:37 +00:00
Bastien Nocera
486e6b0260 committing patch from Sebastien Bacher <seb128@debian.org> for Linux 2.6
2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* glibtop_server.h:
	* mem.c: (glibtop_get_mem_s):
	* swap.c: (glibtop_get_swap_s): committing patch from Sebastien
	Bacher <seb128@debian.org> for Linux 2.6 support (Closes: #104747)
2003-10-20 20:41:06 +00:00
Bastien Nocera
1c96e35cc0 fix swap sizes in FreeBSD, patch by edwin@mavetju.org
2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* swap.c: (glibtop_get_swap_p): fix swap sizes in FreeBSD,
	patch by edwin@mavetju.org
2003-10-20 19:53:57 +00:00
Bastien Nocera
83a3d5f76d make it compile
2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* configure.in: make it compile
2003-10-20 12:14:10 +00:00
27 changed files with 2190 additions and 639 deletions

View File

@@ -1,3 +1,34 @@
2003-12-19 Bastien Nocera <hadess@hadess.net>
* configure.in: 2.0.8 (huh?)
2003-11-04 Žygimantas Beručka <uid0@tuxfamily.org>
* configure.in: Added "lt" to ALL_LINGUAS.
2003-10-21 Bastien Nocera <hadess@hadess.net>
* lib/read.c: (glibtop_read_l):
* lib/read_data.c: (glibtop_read_data_l):
* lib/write.c: (glibtop_write_l):
reverted string freeze breakage
2003-10-20 Bastien Nocera <hadess@hadess.net>
* lib/read.c: (glibtop_read_l):
* lib/read_data.c: (glibtop_read_data_l):
* lib/write.c: (glibtop_write_l): apply patch for ngettext support
by Christian Neumair <chris@gnome-de.org>
2003-10-20 Bastien Nocera <hadess@hadess.net>
* src/inodedb/Makefile.am: link to libgtop_suid_common-2.0.la
(Closes: #107990)
2003-10-20 Bastien Nocera <hadess@hadess.net>
* configure.in: make it compile
2003-10-19 Carlos Perelló Marín <carlos@gnome.org>
* support/*: Reverted libgtop changes. It's a common module

View File

@@ -5,14 +5,22 @@ dnl
AC_INIT(copyright.txt)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
# 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=2
LIBGTOP_MINOR_VERSION=0
LIBGTOP_MICRO_VERSION=5
LIBGTOP_MICRO_VERSION=8
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION)
LIBGTOP_INTERFACE_AGE=5
LIBGTOP_BINARY_AGE=5
LIBGTOP_INTERFACE_AGE=8
LIBGTOP_BINARY_AGE=8
# you can set this to `-snap' for instance to create
# a `libgtop-1.x.y-snap.tar.gz' tarball.
@@ -285,7 +293,7 @@ AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
ALL_LINGUAS="am ar az be bg bn ca cs cy da de el es et fa fi fr ga gl he hi hu id it ja ko lv mk ml mn ms nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi zh_CN zh_TW"
ALL_LINGUAS="am ar az be bg bn ca cs cy da de el es et fa fi fr ga gl he hi hu id it ja ko lt lv mk ml mn ms nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi zh_CN zh_TW"
GETTEXT_PACKAGE=libgtop-2.0
AC_SUBST(GETTEXT_PACKAGE)
@@ -479,5 +487,6 @@ lib/Makefile
examples/Makefile
doc/Makefile
support/Makefile
support/gnome-support-2.0.pc
libgtop-2.0.pc
])

View File

@@ -1,3 +1,39 @@
2004-02-06 Laurent Dhima <laurenti@alblinux.net>
* sq.po: Updated Albanian translation.
2003-11-04 Žygimantas Beručka <uid0@tuxfamily.org>
* lt.po: Added Lithuanian translation by Tomas Kuliavas.
2003-11-03 Jordi Mallach <jordi@sindominio.net>
* ca.po: Typo fixes by Jordi Mas <jmas@softcatala.org>.
2003-10-29 Vincent van Adrighem <adrighem@gnome.org>
* nl.po: Dutch translation updated by Jeroen van der Vegt.
2003-10-25 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation.
2003-10-22 Vincent van Adrighem <adrighem@gnome.org>
* nl.po: Dutch translation updated by Vincent van Adrighem.
2003-10-22 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
2003-10-21 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation.
2003-10-21 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
2003-10-19 Carlos Perelló Marín <carlos@gnome.org>
* POTFILES.ignore: Removed, we use now POTFILES.skip

View File

@@ -5,7 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: libgtop 2.0.0\n"
"POT-Creation-Date: 2003-02-22 23:04+0100\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-10-26 19:04+0100\n"
"PO-Revision-Date: 2003-02-22 23:05+0100\n"
"Last-Translator: Jordi Mallach <jordi@sindominio.net>\n"
"Language-Team: Catalan <gnome@softcatala.net>\n"
@@ -113,39 +114,39 @@ msgstr "llegeix els %d bytes de les dades"
msgid "write %d bytes"
msgstr "escriu els %d bytes"
#: src/daemon/gnuserv.c:448
#: src/daemon/gnuserv.c:453
msgid "Enable debugging"
msgstr "Activa la depuració"
#: src/daemon/gnuserv.c:448
#: src/daemon/gnuserv.c:453
msgid "DEBUG"
msgstr "DEPURACIÓ"
#: src/daemon/gnuserv.c:450
#: src/daemon/gnuserv.c:455
msgid "Enable verbose output"
msgstr "Activa la sortida detallada"
#: src/daemon/gnuserv.c:450
#: src/daemon/gnuserv.c:455
msgid "VERBOSE"
msgstr "DETALLA"
#: src/daemon/gnuserv.c:452
#: src/daemon/gnuserv.c:457
msgid "Don't fork into background"
msgstr "No bifurquis dintre del fons"
#: src/daemon/gnuserv.c:452
#: src/daemon/gnuserv.c:457
msgid "NO-DAEMON"
msgstr "SENSE DIMONIS"
#: src/daemon/gnuserv.c:454
#: src/daemon/gnuserv.c:459
msgid "Invoked from inetd"
msgstr "Ha estat cridat des d'inetd"
#: src/daemon/gnuserv.c:454
#: src/daemon/gnuserv.c:459
msgid "INETD"
msgstr "INETD"
#: src/daemon/gnuserv.c:488
#: src/daemon/gnuserv.c:493
#, c-format
msgid ""
"Error on option %s: %s.\n"
@@ -162,7 +163,7 @@ msgstr "Error del sitema desconegut"
#: support/getopt.c:669
#, c-format
msgid "%s: option `%s' is ambiguous\n"
msgstr "%s: L'opció '%s' és ambígua\n"
msgstr "%s: L'opció '%s' és ambigua\n"
#: support/getopt.c:693
#, c-format
@@ -211,18 +212,18 @@ msgstr "%s: Cal un argument per a l'opció --%c\n"
#: support/getopt.c:854
#, c-format
msgid "%s: option `-W %s' is ambiguous\n"
msgstr "%s: L'opció '-W %s' és ambígua\n"
msgstr "%s: L'opció '-W %s' és ambigua\n"
#: support/getopt.c:872
#, c-format
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: L'opció '-W%s' no permet un argument\n"
#: support/popthelp.c:35
#: support/popthelp.c:23
msgid "Show this help message"
msgstr "Mostra aquest missatge d'ajuda"
#: support/popthelp.c:36
#: support/popthelp.c:24
msgid "Display brief usage message"
msgstr "Mostra un breu missatge d'ús"
@@ -657,7 +658,7 @@ msgid ""
"textual name. (If you have an up-to-date /etc/psdatabase, then try ps -l to "
"see the WCHAN field in action)"
msgstr ""
"Aquest és el \"canal\" on el procés està esperant. Aquesta és la adreça de "
"Aquest és el \"canal\" on el procés està esperant. Aquesta és l'adreça de "
"la crida al sistema, i pot ser consultada en una llista si us cal un nom "
"textual. (Si teniu un /etc/psdatabase actualitzat, intenteu llavors ps -lper "
"veure el camp WCHAN en acció)"
@@ -763,7 +764,7 @@ msgstr "Mida del conjunt resident de biblioteques compartides"
#: sysdeps/names/procsegment.c:50
msgid "Data resident set size"
msgstr "Mida del conjut de dades"
msgstr "Mida del conjunt de dades"
#: sysdeps/names/procsegment.c:51
msgid "Stack resident set size"
@@ -1327,11 +1328,11 @@ msgstr "L'estat del fill ha canviat"
#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48
msgid "Background read from tty"
msgstr "Llegida de tty en segón pla"
msgstr "Llegida de tty en segon pla"
#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49
msgid "Background write to tty"
msgstr "Escriptura a tty en segón pla"
msgstr "Escriptura a tty en segon pla"
#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50
msgid "I/O now possible"

543
po/de.po

File diff suppressed because it is too large Load Diff

1442
po/lt.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,13 +6,14 @@ msgid ""
msgstr ""
"Project-Id-Version: libgtop CVS\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-06-21 12:58+0200\n"
"POT-Creation-Date: 2003-10-29 14:00+0100\n"
"PO-Revision-Date: 2002-10-29 13:14+0100\n"
"Last-Translator: Jeroen van der Vegt <A.J.vanderVegt@ITS.TUDelft.nl>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: examples/smp.c:71
#, c-format
@@ -103,12 +104,12 @@ msgstr "grootte van de gelezen data"
#: lib/read_data.c:66
#, c-format
msgid "read data %d bytes"
msgstr "lees %d bytes"
msgstr "data lezen %d bytes"
#: lib/write.c:48
#, c-format
msgid "write %d bytes"
msgstr "schrijf %d bytes"
msgstr "schrijven %d bytes"
#: src/daemon/gnuserv.c:453
msgid "Enable debugging"
@@ -214,11 +215,11 @@ msgstr "%s: optie '-W %s' is dubbelzinnig\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: optie '-W %s' staat geen argument toe\n"
#: support/popthelp.c:35
#: support/popthelp.c:23
msgid "Show this help message"
msgstr "Laat deze uitleg zien"
#: support/popthelp.c:36
#: support/popthelp.c:24
msgid "Display brief usage message"
msgstr "Toon een korte handleiding"

419
po/sq.po

File diff suppressed because it is too large Load Diff

View File

@@ -9,13 +9,14 @@
msgid ""
msgstr ""
"Project-Id-Version: libgtop\n"
"POT-Creation-Date: 2003-02-09 23:12+0100\n"
"PO-Revision-Date: 2003-02-09 23:13+0100\n"
"POT-Creation-Date: 2003-10-22 00:07+0200\n"
"PO-Revision-Date: 2003-10-22 00:08+0200\n"
"Last-Translator: Christian Rose <menthos@menthos.com>\n"
"Language-Team: Swedish <sv@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: examples/smp.c:71
#, c-format
@@ -117,39 +118,39 @@ msgstr "läste %d byte data"
msgid "write %d bytes"
msgstr "skrev %d byte"
#: src/daemon/gnuserv.c:448
#: src/daemon/gnuserv.c:453
msgid "Enable debugging"
msgstr "Aktivera felsökning"
#: src/daemon/gnuserv.c:448
#: src/daemon/gnuserv.c:453
msgid "DEBUG"
msgstr "FELSÖK"
#: src/daemon/gnuserv.c:450
#: src/daemon/gnuserv.c:455
msgid "Enable verbose output"
msgstr "Aktivera utförlig utskrift"
#: src/daemon/gnuserv.c:450
#: src/daemon/gnuserv.c:455
msgid "VERBOSE"
msgstr "UTFÖRLIG"
#: src/daemon/gnuserv.c:452
#: src/daemon/gnuserv.c:457
msgid "Don't fork into background"
msgstr "Grena inte i bakgrunden"
#: src/daemon/gnuserv.c:452
#: src/daemon/gnuserv.c:457
msgid "NO-DAEMON"
msgstr "INGEN-DEMON"
#: src/daemon/gnuserv.c:454
#: src/daemon/gnuserv.c:459
msgid "Invoked from inetd"
msgstr "Startad från inetd"
#: src/daemon/gnuserv.c:454
#: src/daemon/gnuserv.c:459
msgid "INETD"
msgstr "INETD"
#: src/daemon/gnuserv.c:488
#: src/daemon/gnuserv.c:493
#, c-format
msgid ""
"Error on option %s: %s.\n"
@@ -222,11 +223,11 @@ msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: flaggan \"-W %s\" tillåter inga argument\n"
#: support/popthelp.c:35
#: support/popthelp.c:23
msgid "Show this help message"
msgstr "Visa denna hjälptext"
#: support/popthelp.c:36
#: support/popthelp.c:24
msgid "Display brief usage message"
msgstr "Visa kortfattad användningstext"

View File

@@ -1,3 +1,7 @@
2003-10-20 Bastien Nocera <hadess@hadess.net>
* Makefile.am: make it compile
2003-05-11 Andrew Sobala <aes@gnome.org>
* gnuserv.c: (permitted): fix buffer overflow vulnerability

View File

@@ -40,7 +40,7 @@ libgtop_daemon2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \
@sysdeps_suid_lib@ \
$(suid_sysdeps) $(suid_common)\
$(LIBGTOP_LIBS)\
@LIBSUPPORT@ @INTLLIBS@ @libs_xauth@
@LIBSUPPORT@ @INTLLIBS@ @libs_xauth@ -lpopt
libgtop_server2_SOURCES = server.c slave.c io.c version.c daemon.h
libgtop_server2_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la \

View File

@@ -10,6 +10,7 @@ mkinodedb2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \
file_by_inode2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \
$(top_builddir)/sysdeps/common/libgtop_common-2.0.la \
$(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la \
@LIBSUPPORT@ @INTLLIBS@
@LIBSUPPORT@ @INTLLIBS@ \
$(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la
EXTRA_DIST = README.inodedb

View File

@@ -1,3 +1,8 @@
2003-10-20 Bastien Nocera <hadess@hadess.net>
* swap.c: (glibtop_get_swap_p): fix swap sizes in FreeBSD,
patch by edwin@mavetju.org
2001-10-17 Abel Cheung <maddog@linux.org.hk>
* Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop.

View File

@@ -369,8 +369,8 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
buf->flags = _glibtop_sysdeps_swap;
buf->used = kvmsw[nswdev].ksw_used;
buf->total = kvmsw[nswdev].ksw_total;
buf->used = kvmsw[nswdev].ksw_used * getpagesize();
buf->total = kvmsw[nswdev].ksw_total * getpagesize();
buf->free = buf->total - buf->used;

View File

@@ -1,3 +1,38 @@
2004-02-11 Sebastien Bacher <seb128@debian.org>
* sysdeps/linux/mem.c: (glibtop_get_mem_s): patch from
Beno<6E>t Dejean <bnet@ifrance.com> to fix libtop_mem.used
and glibtop_mem.shared values (Closes: #129863).
2003-12-23 Bastien Nocera <hadess@hadess.net>
* cpu.c: (glibtop_get_cpu_s):
* glibtop_server.h:
* loadavg.c: (glibtop_get_loadavg_s):
* mem.c: (glibtop_get_mem_s):
* netload.c: (glibtop_get_netload_s):
* prockernel.c: (glibtop_get_proc_kernel_s):
* procmem.c: (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_get_proc_segment_s):
* procsignal.c: (glibtop_get_proc_signal_s):
* proctime.c: (glibtop_get_proc_time_s):
* procuid.c: (glibtop_get_proc_uid_s):
* swap.c: (glibtop_get_swap_s): Apply patch from Benoît Dejean
<bnet@ifrance.com> to fix overflow issues using strtol
(Closes: #129881)
2003-12-23 Bastien Nocera <hadess@hadess.net>
* mem.c: (glibtop_get_mem_s): Fix calculation of used memory,
patch by Benoît Dejean, <bnet@ifrance.com> (Closes: #129863)
2003-10-20 Bastien Nocera <hadess@hadess.net>
* glibtop_server.h:
* mem.c: (glibtop_get_mem_s):
* swap.c: (glibtop_get_swap_s): committing patch from Sebastien
Bacher <seb128@debian.org> for Linux 2.6 support (Closes: #104747)
2001-10-17 Abel Cheung <maddog@linux.org.hk>
* Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop.

View File

@@ -75,10 +75,10 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
p = skip_token (buffer); /* "cpu" */
buf->user = strtoul (p, &p, 0);
buf->nice = strtoul (p, &p, 0);
buf->sys = strtoul (p, &p, 0);
buf->idle = strtoul (p, &p, 0);
buf->user = strtoull (p, &p, 0);
buf->nice = strtoull (p, &p, 0);
buf->sys = strtoull (p, &p, 0);
buf->idle = strtoull (p, &p, 0);
total = buf->user;
total += buf->nice;
@@ -94,10 +94,10 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
break;
p += 6;
buf->xcpu_user [i] = strtoul (p, &p, 0);
buf->xcpu_nice [i] = strtoul (p, &p, 0);
buf->xcpu_sys [i] = strtoul (p, &p, 0);
buf->xcpu_idle [i] = strtoul (p, &p, 0);
buf->xcpu_user [i] = strtoull (p, &p, 0);
buf->xcpu_nice [i] = strtoull (p, &p, 0);
buf->xcpu_sys [i] = strtoull (p, &p, 0);
buf->xcpu_idle [i] = strtoull (p, &p, 0);
total = buf->xcpu_user [i];
total += buf->xcpu_nice [i];

View File

@@ -57,6 +57,25 @@ skip_line (const char *p)
return (char *) ++p;
}
static inline unsigned long long
get_scaled(const char *buffer, const char *key)
{
const char *ptr;
char *next;
unsigned long long value = 0;
if ((ptr = strstr(buffer, key)))
{
ptr += strlen(key);
value = strtoull(ptr, &next, 0);
if (strchr(next, 'k'))
value *= 1024;
else if (strchr(next, 'M'))
value *= 1024 * 1024;
}
return value;
}
static inline int
proc_file_to_buffer (char *buffer, const char *fmt, pid_t pid)
{

View File

@@ -67,9 +67,9 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
buffer [len] = '\0';
buf->loadavg [0] = (float) strtod (buffer, &p);
buf->loadavg [1] = (float) strtod (p, &p);
buf->loadavg [2] = (float) strtod (p, &p);
buf->loadavg [0] = strtod (buffer, &p);
buf->loadavg [1] = strtod (p, &p);
buf->loadavg [2] = strtod (p, &p);
buf->flags = _glibtop_sysdeps_loadavg;
@@ -86,9 +86,9 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
p++;
}
buf->nr_running = strtoul (old, &p, 0); p++;
buf->nr_tasks = strtoul (p, &p, 0);
buf->last_pid = strtoul (p, &p, 0);
buf->nr_running = strtoull (old, &p, 0); p++;
buf->nr_tasks = strtoull (p, &p, 0);
buf->last_pid = strtoull (p, &p, 0);
buf->flags |= _glibtop_sysdeps_loadavg_tasks;
}

View File

@@ -46,7 +46,7 @@ glibtop_init_mem_s (glibtop *server)
void
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{
char buffer [BUFSIZ], *p;
char buffer [BUFSIZ];
int fd, len;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
@@ -65,17 +65,13 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
buffer [len] = '\0';
p = skip_line (buffer);
p = skip_token (p); /* "Mem:" */
buf->total = strtoul (p, &p, 0);
buf->used = strtoul (p, &p, 0);
buf->free = strtoul (p, &p, 0);
buf->shared = strtoul (p, &p, 0);
buf->buffer = strtoul (p, &p, 0);
buf->cached = strtoul (p, &p, 0);
buf->total = get_scaled(buffer, "MemTotal:");
buf->free = get_scaled(buffer, "MemFree:");
buf->used = buf->total - buf->free;
buf->shared = 0;
buf->buffer = get_scaled(buffer, "Buffers:");
buf->cached = get_scaled(buffer, "Cached:");
buf->user = buf->total - buf->free - buf->cached - buf->buffer;
buf->flags = _glibtop_sysdeps_mem;
}

View File

@@ -112,7 +112,7 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
skfd = socket (AF_INET, SOCK_DGRAM, 0);
if (skfd) {
struct ifreq ifr;
unsigned flags;
unsigned long long flags;
strcpy (ifr.ifr_name, interface);
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
@@ -197,7 +197,7 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
fgets (buffer, BUFSIZ-1, f);
while (fgets (buffer, BUFSIZ-1, f)) {
unsigned long flags, packets, bytes;
unsigned long long flags, packets, bytes;
char *p, *dev;
/* Skip over the network thing. */
@@ -212,12 +212,12 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
p = skip_token (p);
flags = strtoul (p, &p, 16);
flags = strtoull (p, &p, 16);
p = skip_multiple_token (p, 2);
packets = strtoul (p, &p, 0);
bytes = strtoul (p, &p, 0);
packets = strtoull (p, &p, 0);
bytes = strtoull (p, &p, 0);
if (flags & _GLIBTOP_IP_FW_ACCTIN) {
/* Incoming packets only. */
@@ -317,24 +317,24 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
/* Only read byte counts if we really have them. */
if (have_bytes) {
buf->bytes_in = strtoul (p, &p, 0);
buf->bytes_in = strtoull (p, &p, 0);
fields--;
}
buf->packets_in = strtoul (p, &p, 0);
buf->errors_in = strtoul (p, &p, 0);
buf->packets_in = strtoull (p, &p, 0);
buf->errors_in = strtoull (p, &p, 0);
p = skip_multiple_token (p, fields);
if (have_bytes)
buf->bytes_out = strtoul (p, &p, 0);
buf->bytes_out = strtoull (p, &p, 0);
buf->packets_out = strtoul (p, &p, 0);
buf->errors_out = strtoul (p, &p, 0);
buf->packets_out = strtoull (p, &p, 0);
buf->errors_out = strtoull (p, &p, 0);
p = skip_multiple_token (p, 2);
buf->collisions = strtoul (p, &p, 0);
buf->collisions = strtoull (p, &p, 0);
/* Compute total valules. */

View File

@@ -58,20 +58,20 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
p = skip_multiple_token (p, 6);
buf->k_flags = strtoul (p, &p, 0);
buf->min_flt = strtoul (p, &p, 0);
buf->cmin_flt = strtoul (p, &p, 0);
buf->maj_flt = strtoul (p, &p, 0);
buf->cmaj_flt = strtoul (p, &p, 0);
buf->k_flags = strtoull (p, &p, 0);
buf->min_flt = strtoull (p, &p, 0);
buf->cmin_flt = strtoull (p, &p, 0);
buf->maj_flt = strtoull (p, &p, 0);
buf->cmaj_flt = strtoull (p, &p, 0);
p = skip_multiple_token (p, 15);
buf->kstk_esp = strtoul (p, &p, 0);
buf->kstk_eip = strtoul (p, &p, 0);
buf->kstk_esp = strtoull (p, &p, 0);
buf->kstk_eip = strtoull (p, &p, 0);
p = skip_multiple_token (p, 4);
buf->nwchan = strtoul (p, &p, 0);
buf->nwchan = strtoull (p, &p, 0);
buf->flags = _glibtop_sysdeps_proc_kernel;
}

View File

@@ -82,18 +82,18 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
p = skip_multiple_token (p, 20);
buf->vsize = strtoul (p, &p, 0);
buf->rss = strtoul (p, &p, 0);
buf->rss_rlim = strtoul (p, &p, 0);
buf->vsize = strtoull (p, &p, 0);
buf->rss = strtoull (p, &p, 0);
buf->rss_rlim = strtoull (p, &p, 0);
buf->flags = _glibtop_sysdeps_proc_mem;
if (proc_statm_to_buffer (buffer, pid))
return;
buf->size = strtoul (buffer, &p, 0);
buf->resident = strtoul (p, &p, 0);
buf->share = strtoul (p, &p, 0);
buf->size = strtoull (buffer, &p, 0);
buf->resident = strtoull (p, &p, 0);
buf->share = strtoull (p, &p, 0);
buf->size <<= pageshift;
buf->resident <<= pageshift;

View File

@@ -87,9 +87,9 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
p = skip_multiple_token (p, 23);
buf->start_code = strtoul (p, &p, 0);
buf->end_code = strtoul (p, &p, 0);
buf->start_stack = strtoul (p, &p, 0);
buf->start_code = strtoull (p, &p, 0);
buf->end_code = strtoull (p, &p, 0);
buf->start_stack = strtoull (p, &p, 0);
buf->flags = _glibtop_sysdeps_proc_segment;
@@ -101,10 +101,10 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
/* This doesn't work very well due to a bug in the Linux kernel.
* I'll submit a patch to the kernel mailing list soon. */
buf->text_rss = strtoul (p, &p, 0);
buf->shlib_rss = strtoul (p, &p, 0);
buf->data_rss = strtoul (p, &p, 0);
buf->dirty_size = strtoul (p, &p, 0);
buf->text_rss = strtoull (p, &p, 0);
buf->shlib_rss = strtoull (p, &p, 0);
buf->data_rss = strtoull (p, &p, 0);
buf->dirty_size = strtoull (p, &p, 0);
buf->text_rss <<= pageshift;
buf->shlib_rss <<= pageshift;

View File

@@ -56,10 +56,10 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
p = skip_multiple_token (p, 28);
buf->signal [0] = strtoul (p, &p, 0);
buf->blocked [0] = strtoul (p, &p, 0);
buf->sigignore [0] = strtoul (p, &p, 0);
buf->sigcatch [0] = strtoul (p, &p, 0);
buf->signal [0] = strtoull (p, &p, 0);
buf->blocked [0] = strtoull (p, &p, 0);
buf->sigignore [0] = strtoull (p, &p, 0);
buf->sigcatch [0] = strtoull (p, &p, 0);
buf->flags = _glibtop_sysdeps_proc_signal;
}

View File

@@ -65,16 +65,16 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
p = skip_multiple_token (p, 11);
buf->utime = strtoul (p, &p, 0);
buf->stime = strtoul (p, &p, 0);
buf->cutime = strtoul (p, &p, 0);
buf->cstime = strtoul (p, &p, 0);
buf->utime = strtoull (p, &p, 0);
buf->stime = strtoull (p, &p, 0);
buf->cutime = strtoull (p, &p, 0);
buf->cstime = strtoull (p, &p, 0);
p = skip_multiple_token (p, 2);
buf->timeout = strtoul (p, &p, 0);
buf->it_real_value = strtoul (p, &p, 0);
buf->start_time = strtoul (p, &p, 0);
buf->timeout = strtoull (p, &p, 0);
buf->it_real_value = strtoull (p, &p, 0);
buf->start_time = strtoull (p, &p, 0);
buf->frequency = 100;
@@ -87,16 +87,16 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
return;
p = skip_token (buffer);
buf->utime = strtoul (p, &p, 0);
buf->stime = strtoul (p, &p, 0);
buf->utime = strtoull (p, &p, 0);
buf->stime = strtoull (p, &p, 0);
for (i = 0; i < GLIBTOP_NCPU; i++) {
if (strncmp (p+1, "cpu", 3) || !isdigit (p [4]))
break;
p += 6;
buf->xcpu_utime [i] = strtoul (p, &p, 0);
buf->xcpu_stime [i] = strtoul (p, &p, 0);
buf->xcpu_utime [i] = strtoull (p, &p, 0);
buf->xcpu_stime [i] = strtoull (p, &p, 0);
}
buf->flags |= _glibtop_sysdeps_proc_time_smp;

View File

@@ -66,10 +66,10 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
if (!p) return;
p = skip_token (p); /* "Pid:" */
buf->pid = strtoul (p, &p, 0);
buf->pid = strtol (p, &p, 0);
p = skip_token (p); /* "PPid:" */
buf->ppid = strtoul (p, &p, 0);
buf->ppid = strtol (p, &p, 0);
/* Maybe future Linux versions place something between
* "PPid" and "Uid", so we catch this here. */
@@ -77,8 +77,8 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
if (!p) return;
p = skip_token (p); /* "Uid:" */
buf->uid = strtoul (p, &p, 0);
buf->euid = strtoul (p, &p, 0);
buf->uid = strtol (p, &p, 0);
buf->euid = strtol (p, &p, 0);
/* We don't know how many entries on the "Uid:" line
* future Linux version will have, so we catch this here. */
@@ -86,8 +86,8 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
if (!p) return;
p = skip_token (p); /* "Gid:" */
buf->gid = strtoul (p, &p, 0);
buf->egid = strtoul (p, &p, 0);
buf->gid = strtol (p, &p, 0);
buf->egid = strtol (p, &p, 0);
buf->flags = _glibtop_sysdeps_proc_uid;
@@ -99,15 +99,15 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
p = skip_multiple_token (p, 2);
buf->pgrp = strtoul (p, &p, 0);
buf->session = strtoul (p, &p, 0);
buf->tty = strtoul (p, &p, 0);
buf->tpgid = strtoul (p, &p, 0);
buf->pgrp = strtol (p, &p, 0);
buf->session = strtol (p, &p, 0);
buf->tty = strtol (p, &p, 0);
buf->tpgid = strtol (p, &p, 0);
p = skip_multiple_token (p, 9);
buf->priority = strtoul (p, &p, 0);
buf->nice = strtoul (p, &p, 0);
buf->priority = strtol (p, &p, 0);
buf->nice = strtol (p, &p, 0);
if (buf->tty == 0)
/* the old notty val, update elsewhere bef. moving to 0 */

View File

@@ -70,13 +70,11 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
buffer [len] = '\0';
p = skip_line (buffer);
p = skip_line (p);
p = skip_token (p); /* "Swap:" */
/* Kernel 2.6 with multiple lines */
buf->total = strtoul (p, &p, 0);
buf->used = strtoul (p, &p, 0);
buf->free = strtoul (p, &p, 0);
buf->total = get_scaled(buffer, "SwapTotal:");
buf->free = get_scaled(buffer, "SwapFree:");
buf->used = buf->total - buf->free;
buf->flags = _glibtop_sysdeps_swap;
@@ -97,8 +95,8 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
p = skip_token (p);
buf->pagein = strtoul (p, &p, 0);
buf->pageout = strtoul (p, &p, 0);
buf->pagein = strtoull (p, &p, 0);
buf->pageout = strtoull (p, &p, 0);
buf->flags |= _glibtop_sysdeps_swap_paging;
}