Compare commits

..

51 Commits

Author SHA1 Message Date
Benoît Dejean
eff32adaa4 Fixed C99 macros. Closes #161994. Patch by Vincent Berger
* include/glibtop/error.h:
	* sysdeps/common/error.c: Fixed C99 macros. Closes #161994.
	Patch by Vincent Berger <vincent.berger@ext.bull.net>.
2004-12-22 18:12:52 +00:00
Benoît Dejean
3aabc5fb13 Ignores unkown file system type.
* mountlist.c: (ignore_mount_entry): Ignores unkown file system type.
2004-12-09 16:00:15 +00:00
Benoît Dejean
12f4129f6d Updated.
* reference.texi: Updated.
2004-12-04 19:21:57 +00:00
Benoît Dejean
29d88e177b Released 2.8.2.
* NEWS:
	* configure.in: Released 2.8.2.
2004-12-04 15:50:46 +00:00
Benoît Dejean
3fe19138de Fixed procstate test.
* proclist.c: (glibtop_get_proclist_s): Fixed procstate test.
2004-11-29 19:47:48 +00:00
Martin Willemoes Hansen
b3b674f7df Updated Danish translation.
* da.po: Updated Danish translation.
2004-11-23 12:36:25 +00:00
Benoît Dejean
3c029f5a28 Added a check for NULL pointer when wlaking though interfaces (though i
* netload.c: (get_ipv6), (glibtop_get_netload_s): Added a check for NULL
	pointer when wlaking though interfaces (though i don't understand why some
	interface don't have an ifa_addr).
	Move all ipv6 code into a separate function. Added a paranoid check on
	getifaddrs.
2004-11-15 15:02:43 +00:00
Benoît Dejean
fdf313cdf6 Set .rtime. At last !
* proctime.c: (glibtop_get_proc_time_s): Set .rtime. At last !
2004-10-26 20:26:25 +00:00
Ankitkumar Rameshchandra Patel
9a6bb02fb1 ankit@redhat.com * Changed some wrong rendered characters 2004-10-26 12:06:56 +00:00
Benoît Dejean
e6f0664c3b No longer abort() is no such pid. buf.flags == 0ULL means that there no
* procargs.c: (glibtop_get_proc_args_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):
	* procstate.c: (glibtop_get_proc_state_s):
	* proctime.c: (glibtop_get_proc_time_s):
	* procuid.c: (glibtop_get_proc_uid_s): No longer abort() is no such pid.
	buf.flags == 0ULL means that there no data could be retrieve at all.
	Closes #154876. Thanks to Christophe Belle.
2004-10-22 15:35:57 +00:00
Benoît Dejean
405f0602e0 Released 2.8.1.
* NEWS: Released 2.8.1.
2004-10-11 18:11:48 +00:00
Benoît Dejean
b3dfc1d1d2 Updated. Lots of cleanup.
* cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s):
        * loadavg.c: (glibtop_get_loadavg_s):
        * mem.c: (glibtop_init_mem_s), (glibtop_get_mem_s):
        * open.c: (glibtop_get_kstats), (glibtop_open_s):
        * procargs.c: (glibtop_get_proc_args_s):
        * procdata.c: (glibtop_get_proc_data_psinfo_s),
        (glibtop_get_proc_data_usage_s), (glibtop_get_proc_credentials_s),
        (glibtop_get_proc_status_s):
        * proclist.c: (glibtop_get_proclist_s):
        * procmap.c: (glibtop_get_proc_map_s):
        * procmem.c: (glibtop_get_proc_mem_s):
        * procstate.c: (glibtop_get_proc_state_s):
        * safeio.c:
        * safeio.h:
        * shm_limits.c: (glibtop_init_shm_limits_p),
        (glibtop_get_shm_limits_p):
        * swap.c: (glibtop_get_swap_s):
        * uptime.c: (glibtop_get_uptime_s): Updated. Lots of cleanup.
2004-10-11 18:01:25 +00:00
Benoît Dejean
13025c6c5f Replaced C99 initializer.
* lib/init.c: Replaced C99 initializer.

	* lib/read.c: (do_read): 1-line cleanup.
2004-10-10 17:21:57 +00:00
Benoît Dejean
bbcbe6b67d Depends on glib 2.4.0
* configure.in: Depends on glib 2.4.0
2004-10-09 12:47:10 +00:00
Benoît Dejean
6c586e844f Fixed .state to follow LibGTop2 specification.
* procstate.c: (glibtop_get_proc_state_s): Fixed .state to follow
	LibGTop2 specification.
2004-10-04 12:22:15 +00:00
Benoît Dejean
a1677aefa8 Fixed glibtop_init_s call.
* procmap.c: (glibtop_get_proc_map_s): Fixed glibtop_init_s call.
2004-10-04 12:08:44 +00:00
Benoît Dejean
9f91b2ddb8 AIX support updated by Laurent Vivier <Laurent.Vivier@BULL.NET>.
* Makefile.am:
	* cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p):
	* glibtop_machine.h:
	* glibtop_server.h:
	* mem.c: (glibtop_get_mem_s):
	* netload.c: (glibtop_get_netload_p):
	* procargs.c: (glibtop_get_proc_args_s):
	* prockernel.c: (glibtop_get_proc_kernel_s):
	* proclist.c: (glibtop_get_proclist_s):
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s):
	* procsignal.c: (glibtop_get_proc_signal_s):
	* procstate.c: (glibtop_get_proc_state_s):
	* proctime.c: (glibtop_get_proc_time_s):
	* procuid.c: (glibtop_get_proc_uid_s):
	* swap.c: (glibtop_get_swap_s):
	* sysinfo.c: (add_info), (init_sysinfo):
	* uptime.c: (glibtop_init_uptime_s), (glibtop_get_uptime_s):

	AIX support updated by Laurent Vivier <Laurent.Vivier@BULL.NET>.

	Fixed cpu/uptime/sysinfo.
	Added missing calls to glibtop_init_s.
2004-10-04 11:57:05 +00:00
Adam Weinberger
ca8d9657f0 Updated Canadian English translation.
* en_CA.po: Updated Canadian English translation.
2004-09-26 15:23:08 +00:00
Benoît Dejean
5bd4c5feeb Added missing include <glibtop/close.h>.
* glibtop.h: Added missing include <glibtop/close.h>.
2004-09-25 19:31:18 +00:00
Benoît Dejean
15a4ba35a9 Re-added pprint_get_msg_limits()
* pprint.c: (main): Re-added pprint_get_msg_limits()
2004-09-25 19:30:00 +00:00
Benoît Dejean
f028bd79bf Added missing call to glibgtop_init() / glibtop_close()
* df.c: (main):
	* pprint.c: (main):
	* procargs.c: (main): Added missing call to glibgtop_init() / glibtop_close()
2004-09-25 08:56:38 +00:00
Benoît Dejean
d809faba3e Added missing call to libgtop_init();
* df.c: (main):
	* pprint.c: (main):
	* procargs.c: (main): Added missing call to libgtop_init();
2004-09-25 08:46:44 +00:00
Benoît Dejean
d0833edb66 Fixed .block_size on Solaris.
* fsusage.c: (glibtop_get_fsusage_s): Fixed .block_size on Solaris.
2004-09-24 21:26:34 +00:00
Benoît Dejean
9aae957919 ../configure.in Added new example, just like 'df'.
* .cvsignore:
	* Makefile.am:
	* ../configure.in
	* df.c: (print_fsusage), (main): Added new example, just like 'df'.
2004-09-24 12:59:29 +00:00
Benoît Dejean
6d24f84fd6 Updated.
* POTFILES.in: Updated.
2004-09-23 22:48:32 +00:00
Benoît Dejean
fe08779c6c Removed mountlist.h.
* Makefile.am:
	* mountlist.c:
	* mountlist.h: Removed mountlist.h.
2004-09-23 22:47:56 +00:00
Benoît Dejean
804b82eff8 Small cleanup.
* loadavg.c: (glibtop_get_loadavg_s):
	* msg_limits.c: (glibtop_get_msg_limits_s):
	* shm_limits.c: (glibtop_get_shm_limits_s): Small cleanup.
2004-09-23 22:44:53 +00:00
Benoît Dejean
61889bc182 Removed get_pageshift(). Every one can affort a * instead of a >>, no need
* glibtop_server.c:
	* glibtop_server.h:
	* procmem.c: (glibtop_get_proc_mem_s):
	* procsegment.c: (glibtop_get_proc_segment_s): Removed get_pageshift().
	Every one can affort a * instead of a >>, no need for this kind of
	non-reentrant optimization. Saved 144B (obviously perfect cleanup ;)
2004-09-23 08:13:28 +00:00
Benoît Dejean
c29887d4b0 Added openpromfs.
* mountlist.c: (ignore_mount_entry): Added openpromfs.
2004-09-22 22:20:31 +00:00
Benoît Dejean
edb1e6a773 CFLAGS: Removed -W, added -Winline.
* configure.in: CFLAGS: Removed -W, added -Winline.
2004-09-22 17:39:18 +00:00
Benoît Dejean
5d97c3fa5e Linux: Sanitize. Removed calls to obfuscated PROPAGATE_ALL_ONES(x) which
* fsusage.c: (glibtop_get_fsusage_s): Linux: Sanitize. Removed calls
        to obfuscated PROPAGATE_ALL_ONES(x) which seems to return unpredictable
        values on some arch (e.g sparc).
        Closes #153141.
2004-09-22 17:38:18 +00:00
Benoît Dejean
e830a8eeb6 Removed #warning, my gcc is not buggy anymore.
* glibtop_server.c: Removed #warning, my gcc is not buggy anymore.
2004-09-22 17:33:19 +00:00
Benoît Dejean
a6410588cd Disable pprint_get_msg_limits() because it can fail.
* pprint.c: (main): Disable pprint_get_msg_limits() because it can fail.
2004-09-22 11:25:37 +00:00
Benoît Dejean
339b79b100 Added mntfs to ignore list
* mountlist.c: (ignore_mount_entry): Added mntfs to ignore list
2004-09-22 11:16:42 +00:00
Ivan Stojmirov
831f0e7d68 gotovo 2004-09-21 21:37:42 +00:00
Benoît Dejean
4882405885 Updated.
* pprint.c: (pprint_get_swap), (main): Updated.
2004-09-21 09:41:34 +00:00
Benoît Dejean
5b15a2d1a5 Updated.
* procargs.c: (show_args), (main): Updated.
2004-09-21 08:37:52 +00:00
Benoît Dejean
6954b81396 Updated.
* pprint.c: (pprint_get_mountlist), (pprint_get_netload),
	(pprint_get_uptime), (main): Updated.
2004-09-21 08:01:45 +00:00
Benoît Dejean
35dd4cf1ca Updated.
* pprint.c: (pprint_get_mountlist): Updated.
2004-09-20 23:44:19 +00:00
Benoît Dejean
0b0b1ab43c Back to previous version.
* fsusage.c: (_glibtop_get_fsusage_read_write),
	(glibtop_get_fsusage_s):
	* mountlist.c: (glibtop_get_mountlist_s): Back to previous version.

	* fsusage.c: (linux_2_6_0), (linux_2_4_0),
	(_glibtop_linux_get_fsusage_read_write): Back to previous version.
	Now set .flags correctly.
2004-09-20 23:43:24 +00:00
Benoît Dejean
a6311d88c3 Updated.
* procargs.c: (show_args), (main): Updated.
2004-09-20 22:05:32 +00:00
Benoît Dejean
f561120748 Updated.
* procargs.c: (show_args), (main): Updated.
2004-09-20 22:03:58 +00:00
Benoît Dejean
b35532dd6f Updated.
* procargs.c: (show_args), (main): Updated.
2004-09-20 22:03:02 +00:00
Benoît Dejean
c7d323749c Added new example : pretty prints the result of glibtop_*. Work in
* .cvsignore:
	* Makefile.am:
	* pprint.c: (pprint_get_cpu), (pprint_get_fsusage),
	(pprint_get_loadavg), (pprint_get_mem), (pprint_get_mountlist),
	(pprint_get_msg_limits), (main): Added new example : pretty prints
	the result of glibtop_*. Work in progress.

	Now builds procargs.

	* ../configure.in: Added to static list.
2004-09-20 20:14:46 +00:00
Alessio Frusciante
3d1997ca94 Updated Italian translation. 2004-09-19 22:03:58 +00:00
Benoît Dejean
b3fd15c190 Updated to match new prototype.
* fsusage.c: (linux_2_6_0), (linux_2_4_0),
	(_glibtop_linux_get_fsusage_read_write): Updated to match new prototype.
2004-09-19 21:03:21 +00:00
Benoît Dejean
601cfef32f : Added new flag. (_glibtop_get_fsusage_read_write): Changed prototype.
* fsusage.c: (_glibtop_get_fsusage_read_write) : Added new flag.
	(_glibtop_get_fsusage_read_write): Changed prototype. Returns TRUE on
	success, then _glibtop_get_fsusage_read_write is set.

	Added comment to locate Linux code.

	* mountlist.c: (read_filesystem_list): Dropped unused need_fs_type parameter.
	This is now default.
	Fixed possible leak.

	(ignore_mount_entry): Added "usbfs" to ignored FS.

	(glibtop_get_mountlist_s): Updated.
2004-09-19 21:02:10 +00:00
Benoît Dejean
86fd7f23c4 'screen' is only defined when AUTH_MAGIC_COOKIE is defined. Added missing
* gnuserv.c: (setup_table): 'screen' is only defined when AUTH_MAGIC_COOKIE
	is defined.
	Added missing initializers for popt options.
2004-09-19 12:08:55 +00:00
Benoît Dejean
3668b5bb19 Added missing memset( , 0, ).
* mem.c: (glibtop_get_mem_s): Added missing memset( , 0, ).
2004-09-19 12:06:10 +00:00
Gora Mohanty
89f531cdbc configure.in: Added 'or' to ALL_LINGUAS.
po/or.po: Updated Oriya translation.
2004-09-13 20:42:54 +00:00
Benoît Dejean
35488aef90 bumped to 2.8.1.
* configure.in: bumped to 2.8.1.

	* sysdeps/common/fsusage.c:
	* sysdeps/common/gnuslib.c: (glibtop_make_connection),
	(connect_to_unix_server), (glibtop_internet_addr):
	* sysdeps/linux/glibtop_server.c: (get_pageshift):
	* sysdeps/linux/glibtop_server.h:
	* sysdeps/linux/open.c: (glibtop_open_s):
	* sysdeps/linux/ppp.c: (is_ISDN_on): Cleanups. Thanks to Kjartan Maraas.
	Closes #151557.
2004-09-13 15:21:54 +00:00
83 changed files with 2864 additions and 853 deletions

View File

@@ -1,3 +1,53 @@
2004-12-22 Benoît Dejean <tazforever@dlfp.org>
* include/glibtop/error.h:
* sysdeps/common/error.c: Fixed C99 macros. Closes #161994.
Patch by Vincent Berger <vincent.berger@ext.bull.net>.
2004-12-04 Benoît Dejean <tazforever@dlfp.org>
* NEWS:
* configure.in: Released 2.8.2.
2004-10-11 Benoît Dejean <tazforever@dlfp.org>
* NEWS: Released 2.8.1.
2004-10-10 Benoît Dejean <tazforever@dlfp.org>
* lib/init.c: Replaced C99 initializer.
* lib/read.c: (do_read): 1-line cleanup.
2004-10-09 Benoît Dejean <tazforever@dlfp.org>
* configure.in: Depends on glib 2.4.0
2004-09-25 Benoît Dejean <tazforever@dlfp.org>
* glibtop.h: Added missing include <glibtop/close.h>.
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
* configure.in: CFLAGS: Removed -W, added -Winline.
2004-09-14 Gora Mohanty <gmohanty@cvs.gnome.org>
* configure.in: Added 'or' to ALL_LINGUAS.
2004-09-13 Benoît Dejean <tazforever@dlfp.org>
* configure.in: bumped to 2.8.1.
* sysdeps/common/fsusage.c:
* sysdeps/common/gnuslib.c: (glibtop_make_connection),
(connect_to_unix_server), (glibtop_internet_addr):
* sysdeps/linux/glibtop_server.c: (get_pageshift):
* sysdeps/linux/glibtop_server.h:
* sysdeps/linux/open.c: (glibtop_open_s):
* sysdeps/linux/ppp.c: (is_ISDN_on): Cleanups. Thanks to Kjartan Maraas.
Closes #151557.
2004-09-13 Benoît Dejean <tazforever@dlfp.org> 2004-09-13 Benoît Dejean <tazforever@dlfp.org>
* NEWS: * NEWS:

15
NEWS
View File

@@ -1,3 +1,18 @@
December 4, 2004: Overview of Changes from 2.8.1 to 2.8.2
=========================================================
o linux:
- fixed segfault when polling PPP devices with glibtop_get_proclist.
- fixed process state in glibtop_get_proclist.
o updated translations:
- da (Martin Willemoes Hansen)
October 11, 2004: Overview of Changes from 2.8.0 to 2.8.1
=========================================================
* Improved Solaris and AIX support.
August 13, 2004: Overview of Changes from 2.7.92 to 2.8.0 August 13, 2004: Overview of Changes from 2.7.92 to 2.8.0
========================================================= =========================================================
* No changes * No changes

View File

@@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM
LIBGTOP_MAJOR_VERSION=2 LIBGTOP_MAJOR_VERSION=2
LIBGTOP_MINOR_VERSION=8 LIBGTOP_MINOR_VERSION=8
LIBGTOP_MICRO_VERSION=0 LIBGTOP_MICRO_VERSION=2
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION) AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION)
@@ -123,7 +123,7 @@ else
fi fi
if test "x$enable_static" != xno; then if test "x$enable_static" != xno; then
static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $smp_static_examples" static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static timings_static $smp_static_examples pprint_static procargs_static df_static"
else else
static_targets="" static_targets=""
fi fi
@@ -134,7 +134,7 @@ AM_CONDITIONAL(ENABLE_SHARED, test x$enable_static = xyes)
AC_SUBST(static_targets) AC_SUBST(static_targets)
AC_SUBST(smp_examples) AC_SUBST(smp_examples)
GLIB_REQUIRED=2.0.0 GLIB_REQUIRED=2.4.0
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED) PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_CFLAGS)
@@ -255,7 +255,7 @@ AC_TYPE_SIGNAL
AC_FUNC_STRFTIME AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id it ja ko lt lv mi mk ml mn ms nb nl nn no pa 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 bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id it ja ko lt lv mi mk ml mn ms nb nl nn no or pa 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 GETTEXT_PACKAGE=libgtop-2.0
AC_SUBST(GETTEXT_PACKAGE) AC_SUBST(GETTEXT_PACKAGE)
@@ -351,7 +351,7 @@ AC_SUBST(machine_incs)
if test "$GCC" = "yes" ; then if test "$GCC" = "yes" ; then
CFLAGS="\ CFLAGS="\
-W \ -Winline \
-Wall \ -Wall \
-std=gnu89 \ -std=gnu89 \
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \

View File

@@ -1,3 +1,7 @@
2004-12-04 Benoît Dejean <tazforever@dlfp.org>
* reference.texi: Updated.
2004-08-03 Benoît Dejean <tazforever@dlfp.org> 2004-08-03 Benoît Dejean <tazforever@dlfp.org>
* reference.texi: Updated. * reference.texi: Updated.

View File

@@ -1533,6 +1533,8 @@ struct _glibtop_fsusage
files, files,
ffree; ffree;
guint32 block_size; guint32 block_size;
guint64 read,
write;
@}; @};
@end cartouche @end cartouche
@end example @end example
@@ -1550,10 +1552,12 @@ Total file nodes.
Free file nodes. Free file nodes.
@item block_size @item block_size
Block size in bytes. Block size in bytes.
@item read
Total blocks read.
@item write
Total blocks written.
@end table @end table
Blocks are usually 512 bytes.
@page @page
@node Library Functions, , Common Functions, Reference Manual @node Library Functions, , Common Functions, Reference Manual
@section Library Functions @section Library Functions

View File

@@ -14,3 +14,10 @@ second_linux
smp_static sysdeps_static netload_static procmap_static mountlist_static smp_static sysdeps_static netload_static procmap_static mountlist_static
smp sysdeps netload procmap mountlist smp sysdeps netload procmap mountlist
timings timings_static timings timings_static
pprint
pprint_static
procargs
procargs_static
df
df_static

View File

@@ -1,3 +1,58 @@
2004-09-25 Benoît Dejean <tazforever@dlfp.org>
* pprint.c: (main): Re-added pprint_get_msg_limits()
i2004-09-25 Benoît Dejean <tazforever@dlfp.org>
* df.c: (main):
* pprint.c: (main):
* procargs.c: (main): Added missing call to glibgtop_init() / glibtop_close()
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
* .cvsignore:
* Makefile.am:
* ../configure.in
* df.c: (print_fsusage), (main): Added new example, just like 'df'.
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
* pprint.c: (main): Disable pprint_get_msg_limits() because it can fail.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* pprint.c: (pprint_get_swap), (main): Updated.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: (show_args), (main): Updated.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* pprint.c: (pprint_get_mountlist), (pprint_get_netload),
(pprint_get_uptime), (main): Updated.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* pprint.c: (pprint_get_mountlist): Updated.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: (show_args), (main): Updated.
2004-09-20 Benoît Dejean <tazforever@dlfp.org>
* .cvsignore:
* Makefile.am:
* pprint.c: (pprint_get_cpu), (pprint_get_fsusage),
(pprint_get_loadavg), (pprint_get_mem), (pprint_get_mountlist),
(pprint_get_msg_limits), (main): Added new example : pretty prints
the result of glibtop_*. Work in progress.
Now builds procargs.
* ../configure.in: Added to static list.
2004-07-07 Benoît Dejean <tazforever@dlfp.org> 2004-07-07 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: Added glibtop_get_proc_argv demo. * procargs.c: Added glibtop_get_proc_argv demo.

View File

@@ -6,7 +6,7 @@ INCLUDES = @INCLUDES@
DEFS = @DEFS@ DEFS = @DEFS@
noinst_PROGRAMS = first second\ noinst_PROGRAMS = first second pprint procargs df \
mountlist procmap netload sysdeps timings \ mountlist procmap netload sysdeps timings \
@static_targets@ @smp_examples@ @static_targets@ @smp_examples@
@@ -14,7 +14,8 @@ EXTRA_PROGRAMS = first_static second_static \
mountlist_static procmap_static \ mountlist_static procmap_static \
third third_static smp smp_static \ third third_static smp smp_static \
netload_static sysdeps_static \ netload_static sysdeps_static \
timings_static timings_static pprint_static procargs_static \
df_static
first_SOURCES = first.c first_SOURCES = first.c
first_LDADD = $(top_builddir)/lib/libgtop-2.0.la first_LDADD = $(top_builddir)/lib/libgtop-2.0.la
@@ -84,3 +85,27 @@ timings_static_SOURCES = $(timings_SOURCES)
timings_static_LDADD = $(timings_LDADD) timings_static_LDADD = $(timings_LDADD)
timings_static_LDFLAGS = -static timings_static_LDFLAGS = -static
pprint_SOURCES = pprint.c
pprint_LDADD = $(top_builddir)/lib/libgtop-2.0.la
pprint_static_SOURCES = $(pprint_SOURCES)
pprint_static_LDADD = $(pprint_LDADD)
pprint_static_LDFLAGS = -static
procargs_SOURCES = procargs.c
procargs_LDADD = $(top_builddir)/lib/libgtop-2.0.la
procargs_static_SOURCES = $(procargs_SOURCES)
procargs_static_LDADD = $(procargs_LDADD)
procargs_static_LDFLAGS = -static
df_SOURCES = df.c
df_LDADD = $(top_builddir)/lib/libgtop-2.0.la
df_static_SOURCES = $(df_SOURCES)
df_static_LDADD = $(df_LDADD)
df_static_LDFLAGS = -static

48
examples/df.c Normal file
View File

@@ -0,0 +1,48 @@
#include <glibtop.h>
#include <glibtop/fsusage.h>
#include <glibtop/mountlist.h>
#include <stdio.h>
static void print_fsusage(const char *mountpoint)
{
glibtop_fsusage buf;
glibtop_get_fsusage(&buf, mountpoint);
printf("%-20s %-10llu %-10llu %-10llu %.1f\n",
mountpoint,
buf.blocks * buf.block_size >> 20,
(buf.blocks - buf.bavail) * buf.block_size >> 20,
buf.bavail * buf.block_size >> 20,
(buf.blocks - buf.bavail) * 100.0 / buf.blocks
);
}
int main()
{
glibtop_mountlist buf;
glibtop_mountentry *entries;
size_t i;
glibtop_init();
printf("%-20s %-10s %-10s %-10s %-10s\n",
"Filesystem", "Size", "Used", "Avail", "Use%");
entries = glibtop_get_mountlist(&buf, FALSE);
for(i = 0; i < buf.number; ++i)
{
print_fsusage(entries[i].mountdir);
}
g_free(entries);
glibtop_close();
return 0;
}

246
examples/pprint.c Normal file
View File

@@ -0,0 +1,246 @@
#include <glibtop.h>
#include <glibtop/union.h>
#include <stdio.h>
#include <stddef.h>
#define buf_offsetof(MEMBER) ((ptrdiff_t)&(buf.MEMBER) - (ptrdiff_t)&buf)
#define HEADER_PPRINT(FUNC) printf(#FUNC "\tsizeof = %lu B\n", \
(unsigned long) sizeof buf)
#define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \
(unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA)
#define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \
size_t i; \
printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \
(unsigned long) sizeof buf.ARRAY, (unsigned long) buf_offsetof(ARRAY),\
(unsigned long) G_N_ELEMENTS(buf.ARRAY)); \
for(i = 0; i < (SIZE - 1); ++i) printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \
printf(".%u = " FORMAT " }\n", SIZE - 1 , buf.ARRAY[SIZE - 1]); \
} while(0)
#define FOOTER_PPRINT() putchar('\n')
static void pprint_get_cpu()
{
glibtop_cpu buf;
glibtop_get_cpu(&buf);
HEADER_PPRINT(glibtop_get_cpu);
PPRINT(flags, "%#llx");
PPRINT(total, "%llu");
PPRINT(user, "%llu");
PPRINT(nice, "%llu");
PPRINT(sys, "%llu");
PPRINT(idle, "%llu");
PPRINT(frequency, "%llu");
PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu");
PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu");
PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu");
PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu");
PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu");
PPRINT(xcpu_flags, "%llx");
FOOTER_PPRINT();
}
static void pprint_get_fsusage(const char *mountpoint)
{
glibtop_fsusage buf;
glibtop_get_fsusage(&buf, mountpoint);
HEADER_PPRINT(glibtop_get_fsusage);
PPRINT(flags, "%#llx");
PPRINT(blocks, "%llu");
PPRINT(bfree, "%llu");
PPRINT(bavail, "%llu");
PPRINT(files, "%llu");
PPRINT(ffree, "%llu");
PPRINT(block_size, "%u");
PPRINT(read, "%llu");
PPRINT(write, "%llu");
FOOTER_PPRINT();
}
static void pprint_get_loadavg()
{
glibtop_loadavg buf;
glibtop_get_loadavg(&buf);
HEADER_PPRINT(glibtop_get_loadavg);
PPRINT(flags, "%#llx");
PPRINT_ARRAY(loadavg, 3, "%f");
PPRINT(nr_running, "%llu");
PPRINT(nr_tasks, "%llu");
PPRINT(last_pid, "%llu");
FOOTER_PPRINT();
}
static void pprint_get_mem()
{
glibtop_mem buf;
glibtop_get_mem(&buf);
HEADER_PPRINT(glibtop_get_mem);
PPRINT(flags, "%#llx");
PPRINT(total, "%llu");
PPRINT(used, "%llu");
PPRINT(free, "%llu");
PPRINT(shared, "%llu");
PPRINT(buffer, "%llu");
PPRINT(cached, "%llu");
PPRINT(user, "%llu");
PPRINT(locked, "%llu");
FOOTER_PPRINT();
}
static void pprint_get_mountlist(gboolean allfs)
{
glibtop_mountlist buf;
glibtop_mountentry *entries;
size_t i;
entries = glibtop_get_mountlist(&buf, allfs);
HEADER_PPRINT(glibtop_get_mountlist);
PPRINT(flags, "%#llx");
PPRINT(number, "%llu");
PPRINT(total, "%llu");
PPRINT(size, "%llu");
printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number);
for(i = 0; i < buf.number; ++i)
{
printf("\t\t .%lu = { .dev = %#llx,"
" .devname = \"%s\","
" .mountir = \"%s\","
" .type = \"%s\" }\n",
(unsigned long) i, entries[i].dev,
entries[i].devname,
entries[i].mountdir,
entries[i].type);
}
printf("\t\t}\n");
FOOTER_PPRINT();
g_free(entries);
}
static void pprint_get_msg_limits()
{
glibtop_msg_limits buf;
glibtop_get_msg_limits(&buf);
HEADER_PPRINT(glibtop_get_msg_limits);
PPRINT(flags, "%#llx");
PPRINT(msgpool, "%llu");
PPRINT(msgmap, "%llu");
PPRINT(msgmax, "%llu");
PPRINT(msgmnb, "%llu");
PPRINT(msgmni, "%llu");
PPRINT(msgssz, "%llu");
PPRINT(msgtql, "%llu");
FOOTER_PPRINT();
}
static void pprint_get_netload(const char *iface)
{
glibtop_netload buf;
glibtop_get_netload(&buf, iface);
HEADER_PPRINT(glibtop_get_netload);
FOOTER_PPRINT();
}
static void pprint_get_swap()
{
glibtop_swap buf;
glibtop_get_swap(&buf);
HEADER_PPRINT(glibtop_get_swap);
PPRINT(flags, "%#llx");
PPRINT(total, "%llu");
PPRINT(used, "%llu");
PPRINT(free, "%llu");
PPRINT(pagein, "%llu");
PPRINT(pageout, "%llu");
FOOTER_PPRINT();
}
static void pprint_get_uptime()
{
glibtop_uptime buf;
glibtop_get_uptime(&buf);
HEADER_PPRINT(glibtop_get_uptime);
PPRINT(flags, "%#llx");
PPRINT(uptime, "%f");
PPRINT(idletime, "%f");
PPRINT(boot_time, "%llu");
FOOTER_PPRINT();
}
int main()
{
glibtop_init();
pprint_get_cpu();
pprint_get_fsusage("/");
pprint_get_loadavg();
pprint_get_mem();
pprint_get_mountlist(TRUE);
pprint_get_mountlist(FALSE);
pprint_get_msg_limits();
/* pprint_get_netload("lo"); */
pprint_get_swap();
/* pprint_get_sysinfo(); */
pprint_get_uptime();
glibtop_close();
return 0;
}

View File

@@ -1,16 +1,14 @@
#include <glibtop.h>
#include <glibtop/procargs.h> #include <glibtop/procargs.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main(int argc, char **argv) static void show_args(pid_t pid, unsigned max_len)
{
while(*++argv)
{ {
glibtop_proc_args buf; glibtop_proc_args buf;
pid_t pid = strtol(*argv, NULL, 10); char ** const pargv = glibtop_get_proc_argv(&buf, pid, max_len);
char ** const pargv = glibtop_get_proc_argv(&buf, pid, 20);
char **parg = pargv; char **parg = pargv;
@@ -18,7 +16,7 @@ int main(int argc, char **argv)
while(*parg) while(*parg)
{ {
printf("\"%s\"\t", *parg); printf("\"%s\" ", *parg);
parg++; parg++;
} }
@@ -26,5 +24,24 @@ int main(int argc, char **argv)
g_strfreev(pargv); g_strfreev(pargv);
} }
int main(int argc, char **argv)
{
glibtop_init();
show_args(getpid(), 0);
show_args(getpid(), 15);
while(*++argv)
{
pid_t pid = strtol(*argv, NULL, 10);
show_args(pid, 0);
show_args(pid, 15);
}
glibtop_close();
return 0;
} }

View File

@@ -43,6 +43,7 @@ typedef struct _glibtop glibtop;
#include <glibtop/sysdeps.h> #include <glibtop/sysdeps.h>
#include <glibtop/close.h>
struct _glibtop struct _glibtop
{ {

View File

@@ -50,11 +50,11 @@ void G_GNUC_UNUSED glibtop_warn_io_r (glibtop *server, char *format, ...);
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define glibtop_error(p1, ...) glibtop_error_r(glibtop_global_server , p1 , __VA_ARGS__) #define glibtop_error(...) glibtop_error_r(glibtop_global_server , __VA_ARGS__)
#define glibtop_warn(p1, ...) glibtop_warn_r(glibtop_global_server , p1 , __VA_ARGS__) #define glibtop_warn(...) glibtop_warn_r(glibtop_global_server , __VA_ARGS__)
#define glibtop_error_io(p1, ...) glibtop_error_io_r(glibtop_global_server , p1 , __VA_ARGS__) #define glibtop_error_io(...) glibtop_error_io_r(glibtop_global_server , __VA_ARGS__)
#define glibtop_warn_io(p1, ...) glibtop_warn_io_r(glibtop_global_server , p1 , __VA_ARGS__) #define glibtop_warn_io(...) glibtop_warn_io_r(glibtop_global_server , __VA_ARGS__)
#else /* no __GNUC__, no C99*/ #else /* no __GNUC__, no C99*/

View File

@@ -29,7 +29,7 @@
#define DEFAULT_PORT 42800 #define DEFAULT_PORT 42800
#endif #endif
static glibtop _glibtop_global_server = { .flags = 0 }; static glibtop _glibtop_global_server = { 0 };
glibtop *glibtop_global_server = &_glibtop_global_server; glibtop *glibtop_global_server = &_glibtop_global_server;
static void static void

View File

@@ -42,8 +42,7 @@ do_read (int s, void *ptr, size_t total_size)
if(nread == 0) if(nread == 0)
close (s); close (s);
else if (nread < 0)
if (nread < 0)
glibtop_error_io ("recv"); glibtop_error_io ("recv");
} }

View File

@@ -1,3 +1,23 @@
2004-11-23 Martin Willemoes Hansen <mwh@sysrq.dk>
* da.po: Updated Danish translation.
2004-09-26 Adam Weinberger <adamw@gnome.org>
* en_CA.po: Updated Canadian English translation.
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
* POTFILES.in: Updated.
2004-09-20 Alessio Frusciante <algol@firenze.linux.it>
* it.po: Updated Italian translation.
2004-09-14 Gora Mohanty <gmohanty@cvs.gnome.org>
* or.po: Updated Oriya translation.
2004-09-12 Laszlo Dvornik <dvornik@gnome.hu> 2004-09-12 Laszlo Dvornik <dvornik@gnome.hu>
* hu.po: Updated Hungarian translation by Gabor Kelemen. * hu.po: Updated Hungarian translation by Gabor Kelemen.

View File

@@ -57,7 +57,6 @@ sysdeps/common/fsusage.c
sysdeps/common/gnuslib.c sysdeps/common/gnuslib.c
sysdeps/common/inodedb.c sysdeps/common/inodedb.c
sysdeps/common/mountlist.c sysdeps/common/mountlist.c
sysdeps/common/mountlist.h
sysdeps/common/sysdeps_suid.c sysdeps/common/sysdeps_suid.c
sysdeps/linux/close.c sysdeps/linux/close.c
sysdeps/linux/cpu.c sysdeps/linux/cpu.c

View File

@@ -6,15 +6,13 @@
# Ole Laursen <olau@hardworking.dk>, 2002, 03. # Ole Laursen <olau@hardworking.dk>, 2002, 03.
# Martin Willemoes Hansen <mwh@sysrq.dk>, 2004. # Martin Willemoes Hansen <mwh@sysrq.dk>, 2004.
# #
# BEMÆRK: oversættelsen er overhovedet ikke blevet rettet igennem.
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop\n" "Project-Id-Version: libgtop\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-08-23 12:21+0200\n" "POT-Creation-Date: 2004-11-23 13:36+0100\n"
"PO-Revision-Date: 2004-08-23 12:21+0200\n" "PO-Revision-Date: 2004-11-23 13:35+0100\n"
"Last-Translator: Ole Laursen <olau@hardworking.dk>\n" "Last-Translator: Martin Willemoes Hansen <mwh@sysrq.dk>\n"
"Language-Team: Danish <dansk@klid.dk>\n" "Language-Team: Danish <dansk@klid.dk>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -102,7 +100,7 @@ msgstr "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
msgid "Spin:" msgid "Spin:"
msgstr "Spin:" msgstr "Spin:"
#: lib/read.c:65 #: lib/read.c:64
#, c-format #, c-format
msgid "read %d byte" msgid "read %d byte"
msgid_plural "read %d bytes" msgid_plural "read %d bytes"
@@ -127,39 +125,39 @@ msgid_plural "write %d bytes"
msgstr[0] "skriv %d byte" msgstr[0] "skriv %d byte"
msgstr[1] "skriv %d byte" msgstr[1] "skriv %d byte"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "Enable debugging" msgid "Enable debugging"
msgstr "Slå fejlfinding til" msgstr "Slå fejlfinding til"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "DEBUG" msgid "DEBUG"
msgstr "DEBUG" msgstr "FEJLFINDING"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "Slå meddelsom udskrift til" msgstr "Slå meddelsom udskrift til"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "VERBOSE" msgid "VERBOSE"
msgstr "VERBOSE" msgstr "MEDDELSOM"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "Forgren ikke til baggrund" msgstr "Forgren ikke til baggrund"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "NO-DAEMON" msgstr "INGEN-SERVER"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "Kaldt fra inetd" msgstr "Kaldt fra inetd"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:496 #: src/daemon/gnuserv.c:501
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"
@@ -1317,7 +1315,7 @@ msgstr "Afbryd"
#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 #: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34
msgid "EMT error" msgid "EMT error"
msgstr "EMT fejl" msgstr "EMT-fejl"
#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 #: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35
msgid "Floating-point exception" msgid "Floating-point exception"
@@ -1325,7 +1323,7 @@ msgstr "Flydende tals-undtagelse"
#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 #: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36
msgid "Kill" msgid "Kill"
msgstr "Dræb" msgstr "Afslut"
#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 #: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37
msgid "Bus error" msgid "Bus error"

View File

@@ -4,13 +4,12 @@
# Adam Weinberger <adamw@gnome.org>, 2004. # Adam Weinberger <adamw@gnome.org>, 2004.
# #
# #
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop\n" "Project-Id-Version: libgtop\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-08-03 14:09+0200\n" "POT-Creation-Date: 2004-09-26 11:19-0400\n"
"PO-Revision-Date: 2004-07-18 15:51-0500\n" "PO-Revision-Date: 2004-09-26 15:51-0400\n"
"Last-Translator: Adam Weinberger <adamw@gnome.org>\n" "Last-Translator: Adam Weinberger <adamw@gnome.org>\n"
"Language-Team: English/Canada <adamw@FreeBSD.org>\n" "Language-Team: English/Canada <adamw@FreeBSD.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -124,39 +123,39 @@ msgid_plural "write %d bytes"
msgstr[0] "write %d byte" msgstr[0] "write %d byte"
msgstr[1] "write %d bytes" msgstr[1] "write %d bytes"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "Enable debugging" msgid "Enable debugging"
msgstr "Enable debugging" msgstr "Enable debugging"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "DEBUG" msgid "DEBUG"
msgstr "DEBUG" msgstr "DEBUG"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "Enable verbose output" msgstr "Enable verbose output"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "VERBOSE" msgid "VERBOSE"
msgstr "VERBOSE" msgstr "VERBOSE"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "Don't fork into background" msgstr "Don't fork into background"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "NO-DAEMON" msgstr "NO-DAEMON"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "Invoked from inetd" msgstr "Invoked from inetd"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:496 #: src/daemon/gnuserv.c:501
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"
@@ -544,7 +543,6 @@ msgstr "NWChan"
msgid "WChan" msgid "WChan"
msgstr "WChan" msgstr "WChan"
#. K_Flags
#: sysdeps/names/prockernel.c:51 #: sysdeps/names/prockernel.c:51
msgid "" msgid ""
"Kernel flags of the process.\n" "Kernel flags of the process.\n"
@@ -565,7 +563,6 @@ msgstr ""
"\n" "\n"
"The math bit should be a decimal 4, and the traced bit is decimal 10." "The math bit should be a decimal 4, and the traced bit is decimal 10."
#. Min_Flt
#: sysdeps/names/prockernel.c:60 #: sysdeps/names/prockernel.c:60
msgid "" msgid ""
"The number of minor faults the process has made, those which have not " "The number of minor faults the process has made, those which have not "
@@ -574,7 +571,6 @@ msgstr ""
"The number of minor faults the process has made, those which have not " "The number of minor faults the process has made, those which have not "
"required loading a memory page from disk." "required loading a memory page from disk."
#. Maj_Flt
#: sysdeps/names/prockernel.c:63 #: sysdeps/names/prockernel.c:63
msgid "" msgid ""
"The number of major faults the process has made, those which have required " "The number of major faults the process has made, those which have required "
@@ -583,19 +579,16 @@ msgstr ""
"The number of major faults the process has made, those which have required " "The number of major faults the process has made, those which have required "
"loading a memory page from disk." "loading a memory page from disk."
#. CMin_Flt
#: sysdeps/names/prockernel.c:66 #: sysdeps/names/prockernel.c:66
msgid "The number of minor faults that the process and its children have made." msgid "The number of minor faults that the process and its children have made."
msgstr "" msgstr ""
"The number of minor faults that the process and its children have made." "The number of minor faults that the process and its children have made."
#. CMaj_Flt
#: sysdeps/names/prockernel.c:69 #: sysdeps/names/prockernel.c:69
msgid "The number of major faults that the process and its children have made." msgid "The number of major faults that the process and its children have made."
msgstr "" msgstr ""
"The number of major faults that the process and its children have made." "The number of major faults that the process and its children have made."
#. KStk_ESP
#: sysdeps/names/prockernel.c:72 #: sysdeps/names/prockernel.c:72
msgid "" msgid ""
"The current value of esp (32-bit stack pointer), as found in the kernel " "The current value of esp (32-bit stack pointer), as found in the kernel "
@@ -609,7 +602,6 @@ msgstr ""
msgid "The current EIP (32-bit instruction pointer)." msgid "The current EIP (32-bit instruction pointer)."
msgstr "The current EIP (32-bit instruction pointer)." msgstr "The current EIP (32-bit instruction pointer)."
#. NWChan
#: sysdeps/names/prockernel.c:77 #: sysdeps/names/prockernel.c:77
msgid "" msgid ""
"This is the \"channel\" in which the process is waiting. This is the " "This is the \"channel\" in which the process is waiting. This is the "
@@ -943,47 +935,47 @@ msgstr "SMP kernel-mode CPU time accumulated by process"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
msgid "Uid" msgid "Uid"
msgstr "Uid" msgstr "UID"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
msgid "EUid" msgid "EUid"
msgstr "EUid" msgstr "EUID"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
msgid "Gid" msgid "Gid"
msgstr "Gid" msgstr "GID"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
msgid "EGid" msgid "EGid"
msgstr "EGid" msgstr "EGID"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
msgid "SUid" msgid "SUid"
msgstr "SUid" msgstr "SUID"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
msgid "SGid" msgid "SGid"
msgstr "SGid" msgstr "SGID"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
msgid "FSUid" msgid "FSUid"
msgstr "FSUid" msgstr "FSUID"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
msgid "FSGid" msgid "FSGid"
msgstr "FSGid" msgstr "FSGID"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
msgid "Pid" msgid "Pid"
msgstr "Pid" msgstr "PID"
#: sysdeps/names/procuid.c:50 #: sysdeps/names/procuid.c:50
msgid "PPid" msgid "PPid"
msgstr "PPid" msgstr "PPID"
#: sysdeps/names/procuid.c:50 #: sysdeps/names/procuid.c:50
msgid "PGrp" msgid "PGrp"
msgstr "PGrp" msgstr "PGRP"
#: sysdeps/names/procuid.c:50 #: sysdeps/names/procuid.c:50
msgid "Session" msgid "Session"
@@ -991,11 +983,11 @@ msgstr "Session"
#: sysdeps/names/procuid.c:50 #: sysdeps/names/procuid.c:50
msgid "Tty" msgid "Tty"
msgstr "Tty" msgstr "TTY"
#: sysdeps/names/procuid.c:51 #: sysdeps/names/procuid.c:51
msgid "TPGid" msgid "TPGid"
msgstr "TPGid" msgstr "TPGID"
#: sysdeps/names/procuid.c:51 #: sysdeps/names/procuid.c:51
msgid "Priority" msgid "Priority"
@@ -1071,7 +1063,7 @@ msgstr "Kernel scheduling priority"
#: sysdeps/names/procuid.c:71 #: sysdeps/names/procuid.c:71
msgid "Standard unix nice level of process" msgid "Standard unix nice level of process"
msgstr "Standard unix nice level of process" msgstr "Standard UNIX nice level of process"
#: sysdeps/names/procuid.c:72 #: sysdeps/names/procuid.c:72
msgid "Number of additional process groups" msgid "Number of additional process groups"
@@ -1091,11 +1083,11 @@ msgstr "Max number of arrays"
#: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59 #: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59
msgid "Max semaphores system wide" msgid "Max semaphores system wide"
msgstr "Max semaphores system wide" msgstr "Max semaphores, system-wide"
#: sysdeps/names/sem_limits.c:46 sysdeps/names/sem_limits.c:60 #: sysdeps/names/sem_limits.c:46 sysdeps/names/sem_limits.c:60
msgid "Number of undo structures system wide" msgid "Number of undo structures system wide"
msgstr "Number of undo structures system wide" msgstr "Number of undo structures, system-wide"
#: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61 #: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61
msgid "Max semaphores per array" msgid "Max semaphores per array"

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop.HEAD.gu\n" "Project-Id-Version: libgtop.HEAD.gu\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-08-18 12:10+0200\n" "POT-Creation-Date: 2004-10-26 04:44+0200\n"
"PO-Revision-Date: 2004-08-20 15:47+0530\n" "PO-Revision-Date: 2004-10-26 17:39+0530\n"
"Last-Translator: Ankit Patel <ankit@redhat.com>\n" "Last-Translator: Ankit Patel <ankit@redhat.com>\n"
"Language-Team: Gujarati\n" "Language-Team: Gujarati\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -16,6 +16,7 @@ msgstr ""
"<magnet@magnet-i.com>\n" "<magnet@magnet-i.com>\n"
"Plural-Forms: Plural-Forms: nplurals=2; plural=(n!=1);\n\n" "Plural-Forms: Plural-Forms: nplurals=2; plural=(n!=1);\n\n"
"\n" "\n"
"\n"
"X-Generator: KBabel 1.3.1\n" "X-Generator: KBabel 1.3.1\n"
#: examples/smp.c:76 #: examples/smp.c:76
@@ -99,7 +100,7 @@ msgstr "CPU %3d (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"
msgid "Spin:" msgid "Spin:"
msgstr "ફેરવો:" msgstr "ફેરવો:"
#: lib/read.c:65 #: lib/read.c:64
#, c-format #, c-format
msgid "read %d byte" msgid "read %d byte"
msgid_plural "read %d bytes" msgid_plural "read %d bytes"
@@ -124,46 +125,46 @@ msgid_plural "write %d bytes"
msgstr[0] "%d બાઈટ લખો" msgstr[0] "%d બાઈટ લખો"
msgstr[1] "%d બાઈટો લખો" msgstr[1] "%d બાઈટો લખો"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "Enable debugging" msgid "Enable debugging"
msgstr "ભૂલ શોધવાની પ્રક્રિયાને સક્રિય કરો" msgstr "ભૂલ શોધવાની પ્રક્રિયાને સક્રિય કરો"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "DEBUG" msgid "DEBUG"
msgstr "ભૂલ શોધો" msgstr "ભૂલ શોધો"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "વર્ણનીય પરિણામને સક્રિય કરો" msgstr "વર્ણનીય પરિણામને સક્રિય કરો"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "VERBOSE" msgid "VERBOSE"
msgstr "વર્ણનીય" msgstr "વર્ણનીય"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "પાછળના ભાગમાં fork કરો નહિં" msgstr "પાછળના ભાગમાં fork કરો નહિં"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "ડિમન નહિં" msgstr "ડિમન નહિં"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "inetd માંથી શરુ કરાયેલુ" msgstr "inetd માંથી શરુ કરાયેલુ"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:496 #: src/daemon/gnuserv.c:501
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"
"Run '%s --help' to see a full list of available command line options.\n" "Run '%s --help' to see a full list of available command line options.\n"
msgstr "" msgstr ""
"વિકલ્પ %s માં ભૂલ: %s.\n" "વિકલ્પ %s માં ભૂલ: %s.\n"
"પ્રાપ્ય અાદેશના વિકલ્પોની પૂર્ણ યાદિ જોવા માટે '%s --help' ચાલુ કરો.\n" "પ્રાપ્ય દેશના વિકલ્પોની પૂર્ણ યાદિ જોવા માટે '%s --help' ચાલુ કરો.\n"
#: sysdeps/names/cpu.c:44 #: sysdeps/names/cpu.c:44
msgid "Total CPU Time" msgid "Total CPU Time"
@@ -187,7 +188,7 @@ msgstr "ફાજલ કાર્યમાં CPU સમય"
#: sysdeps/names/cpu.c:49 #: sysdeps/names/cpu.c:49
msgid "Tick Frequency" msgid "Tick Frequency"
msgstr "ટકોરની અાવૃત્તિ" msgstr "ટકોરની વૃત્તિ"
#: sysdeps/names/cpu.c:50 #: sysdeps/names/cpu.c:50
msgid "SMP Total CPU Time" msgid "SMP Total CPU Time"
@@ -235,7 +236,7 @@ msgstr "ફાજલ કાર્યમાં સિસ્ટમે પસાર
#: sysdeps/names/cpu.c:65 #: sysdeps/names/cpu.c:65
msgid "Tick frequency (default is 100)" msgid "Tick frequency (default is 100)"
msgstr "ટકોરની અાવૃત્તિ (મૂળભૂત ૧૦૦ છે)" msgstr "ટકોરની વૃત્તિ (મૂળભૂત ૧૦૦ છે)"
#: sysdeps/names/cpu.c:71 #: sysdeps/names/cpu.c:71
msgid "Bit field indicating which CPU is currently running" msgid "Bit field indicating which CPU is currently running"
@@ -291,7 +292,7 @@ msgstr "છેલ્લું PID"
#: sysdeps/names/loadavg.c:48 #: sysdeps/names/loadavg.c:48
msgid "Number of jobs running simultaneously averaged over 1, 5 and 15 minutes" msgid "Number of jobs running simultaneously averaged over 1, 5 and 15 minutes"
msgstr "૧, ૫ અને ૧૫ મિનિટના સરેરાશે અેકસાથે કામો ચાલી રહ્યા છે" msgstr "૧, ૫ અને ૧૫ મિનિટના સરેરાશે કસાથે કામો ચાલી રહ્યા છે"
#: sysdeps/names/loadavg.c:49 #: sysdeps/names/loadavg.c:49
msgid "Number of tasks currently running" msgid "Number of tasks currently running"
@@ -377,7 +378,7 @@ msgstr "યાદીનું કુલ માપ"
#: sysdeps/names/proclist.c:41 sysdeps/names/proclist.c:48 #: sysdeps/names/proclist.c:41 sysdeps/names/proclist.c:48
#: sysdeps/names/procmap.c:41 sysdeps/names/procmap.c:48 #: sysdeps/names/procmap.c:41 sysdeps/names/procmap.c:48
msgid "Size of a single list element" msgid "Size of a single list element"
msgstr "યાદીની અેક વસ્તુનું માપ" msgstr "યાદીની ક વસ્તુનું માપ"
#: sysdeps/names/msg_limits.c:41 sysdeps/names/msg_limits.c:52 #: sysdeps/names/msg_limits.c:41 sysdeps/names/msg_limits.c:52
msgid "Size in kilobytes of message pool" msgid "Size in kilobytes of message pool"
@@ -397,7 +398,7 @@ msgstr "હરોળનું મૂળભૂત મહત્તમ માપ"
#: sysdeps/names/msg_limits.c:45 sysdeps/names/msg_limits.c:56 #: sysdeps/names/msg_limits.c:45 sysdeps/names/msg_limits.c:56
msgid "Max queues system wide" msgid "Max queues system wide"
msgstr "અાખી સિસ્ટમમાં મહત્તમ હરોળ" msgstr "ખી સિસ્ટમમાં મહત્તમ હરોળ"
#: sysdeps/names/msg_limits.c:46 sysdeps/names/msg_limits.c:57 #: sysdeps/names/msg_limits.c:46 sysdeps/names/msg_limits.c:57
msgid "Message segment size" msgid "Message segment size"
@@ -477,7 +478,7 @@ msgstr "IPv6 હદ"
#: sysdeps/names/netload.c:68 #: sysdeps/names/netload.c:68
msgid "Maximum Transfer Unit" msgid "Maximum Transfer Unit"
msgstr "મહત્તમ સ્થળાંતર અેકમ" msgstr "મહત્તમ સ્થળાંતર કમ"
#: sysdeps/names/ppp.c:39 sysdeps/names/ppp.c:46 #: sysdeps/names/ppp.c:39 sysdeps/names/ppp.c:46
msgid "PPP State" msgid "PPP State"
@@ -594,7 +595,7 @@ msgstr "esp (32-બિટ સ્ટેક દર્શક),ની વર્ત
#. KStk_EIP #. KStk_EIP
#: sysdeps/names/prockernel.c:75 #: sysdeps/names/prockernel.c:75
msgid "The current EIP (32-bit instruction pointer)." msgid "The current EIP (32-bit instruction pointer)."
msgstr "વર્તમાન EIP (32-બિટ સૂચના દર્શક)" msgstr "વર્તમાન EIP (32-બિટ સૂચના દર્શક)."
#. NWChan #. NWChan
#: sysdeps/names/prockernel.c:77 #: sysdeps/names/prockernel.c:77
@@ -686,11 +687,11 @@ msgstr "ખોટું માપ"
#: sysdeps/names/procsegment.c:44 #: sysdeps/names/procsegment.c:44
msgid "Start_Code" msgid "Start_Code"
msgstr "શરુઆતનો કાૅડ" msgstr "શરુઆતનો કડ"
#: sysdeps/names/procsegment.c:44 #: sysdeps/names/procsegment.c:44
msgid "End_Code" msgid "End_Code"
msgstr "અંતિમ કાૅડ" msgstr "અંતિમ કડ"
#: sysdeps/names/procsegment.c:44 #: sysdeps/names/procsegment.c:44
msgid "Start_Stack" msgid "Start_Stack"
@@ -718,15 +719,15 @@ msgstr "ખોટા પાનાઓનુ કુલ માપ"
#: sysdeps/names/procsegment.c:54 #: sysdeps/names/procsegment.c:54
msgid "Address of beginning of code segment" msgid "Address of beginning of code segment"
msgstr "કાૅડ વિભાગની શરુઆતનું સરનામું" msgstr "કડ વિભાગની શરુઆતનું સરનામું"
#: sysdeps/names/procsegment.c:55 #: sysdeps/names/procsegment.c:55
msgid "Address of end of code segment" msgid "Address of end of code segment"
msgstr "કાૅડ વિભાગનુ અંતનુ સરનામું" msgstr "કડ વિભાગનુ અંતનુ સરનામું"
#: sysdeps/names/procsegment.c:56 #: sysdeps/names/procsegment.c:56
msgid "Address of the bottom of stack segment" msgid "Address of the bottom of stack segment"
msgstr "સ્ટૅક વિભાગનુ નીચેનુ સરનામુંંંંં" msgstr "સ્ટૅક વિભાગનુ નીચેનુ સરનામું"
#: sysdeps/names/procsignal.c:41 #: sysdeps/names/procsignal.c:41
msgid "Signal" msgid "Signal"
@@ -738,7 +739,7 @@ msgstr "અટકેલુ"
#: sysdeps/names/procsignal.c:41 #: sysdeps/names/procsignal.c:41
msgid "SigIgnore" msgid "SigIgnore"
msgstr "Sig અવગણવુ" msgstr "Sig અવગણવુ"
#: sysdeps/names/procsignal.c:41 #: sysdeps/names/procsignal.c:41
msgid "SigCatch" msgid "SigCatch"
@@ -754,11 +755,11 @@ msgstr "અટકી રહેલા સંકેતોનુ છૂપાવવ
#: sysdeps/names/procsignal.c:48 #: sysdeps/names/procsignal.c:48
msgid "Mask of ignored signals" msgid "Mask of ignored signals"
msgstr "અવગણેલા સંકેતોનુ છૂપાવવુ" msgstr "અવગણેલા સંકેતોનુ છૂપાવવુ"
#: sysdeps/names/procsignal.c:49 #: sysdeps/names/procsignal.c:49
msgid "Mask of caught signals" msgid "Mask of caught signals"
msgstr "પકડાયેલા સંકેતોનુ છૂપાવવુ" msgstr "પકડાયેલા સંકેતોનુ છૂપાવવુ"
#: sysdeps/names/procstate.c:43 #: sysdeps/names/procstate.c:43
msgid "Cmd" msgid "Cmd"
@@ -803,7 +804,7 @@ msgstr "exec() માટે ચલાવી શકાય તેવી ફાઇ
#: sysdeps/names/procstate.c:50 #: sysdeps/names/procstate.c:50
msgid "Single-Char code for process state (S=sleeping)" msgid "Single-Char code for process state (S=sleeping)"
msgstr "પ્રક્રિયાની સ્થિતિ માટે Single-Char કાૅડ (S=sleeping)" msgstr "પ્રક્રિયાની સ્થિતિ માટે Single-Char કડ (S=sleeping)"
#: sysdeps/names/procstate.c:51 #: sysdeps/names/procstate.c:51
msgid "UID of process" msgid "UID of process"
@@ -879,7 +880,7 @@ msgstr "XCPU_STime"
#: sysdeps/names/proctime.c:52 #: sysdeps/names/proctime.c:52
msgid "Start time of process in seconds since the epoch" msgid "Start time of process in seconds since the epoch"
msgstr "ઇપોકથી પ્રક્રિયાનો શરિઆતનો સમય(સેકડમાં)" msgstr "ઇપોકથી પ્રક્રિયાનો શરિઆતનો સમય (સેકન્ડમાં)"
#: sysdeps/names/proctime.c:53 #: sysdeps/names/proctime.c:53
msgid "Real time accumulated by process (should be utime + stime)" msgid "Real time accumulated by process (should be utime + stime)"
@@ -1061,7 +1062,7 @@ msgstr "વધારાના પ્રક્રિયા જૂથોની સ
#: sysdeps/names/procuid.c:73 #: sysdeps/names/procuid.c:73
msgid "Array of additional process groups" msgid "Array of additional process groups"
msgstr "વધારાના પ્રક્રિયા જૂથોનો અૅરે" msgstr "વધારાના પ્રક્રિયા જૂથોનો રે"
#: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57 #: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57
msgid "Number of entries in semaphore map" msgid "Number of entries in semaphore map"
@@ -1069,7 +1070,7 @@ msgstr "સેમાફોર નકશામાં દાખલાની સં
#: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58 #: sysdeps/names/sem_limits.c:44 sysdeps/names/sem_limits.c:58
msgid "Max number of arrays" msgid "Max number of arrays"
msgstr "અૅરૅનો મહત્તમ ક્રમાંક" msgstr "રૅનો મહત્તમ ક્રમાંક"
#: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59 #: sysdeps/names/sem_limits.c:45 sysdeps/names/sem_limits.c:59
msgid "Max semaphores system wide" msgid "Max semaphores system wide"
@@ -1081,11 +1082,11 @@ msgstr "આખી સિસ્ટમમાં રદ કરેલ બંધા
#: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61 #: sysdeps/names/sem_limits.c:47 sysdeps/names/sem_limits.c:61
msgid "Max semaphores per array" msgid "Max semaphores per array"
msgstr "એક અૅરૅમાં મહત્તમ સેમાફોર" msgstr "એક રૅમાં મહત્તમ સેમાફોર"
#: sysdeps/names/sem_limits.c:48 sysdeps/names/sem_limits.c:62 #: sysdeps/names/sem_limits.c:48 sysdeps/names/sem_limits.c:62
msgid "Max ops per semop call" msgid "Max ops per semop call"
msgstr "એક semopના કાૅલમાં મહત્તમ પ્રક્રિયાઓ" msgstr "એક semopના કલમાં મહત્તમ પ્રક્રિયાઓ"
#: sysdeps/names/sem_limits.c:49 sysdeps/names/sem_limits.c:63 #: sysdeps/names/sem_limits.c:49 sysdeps/names/sem_limits.c:63
msgid "Max number of undo entries per process" msgid "Max number of undo entries per process"
@@ -1173,7 +1174,7 @@ msgstr "સિસ્ટમ ચાલુ રહે તેટલો સમય"
#: sysdeps/names/sysdeps.c:55 sysdeps/names/sysdeps.c:82 #: sysdeps/names/sysdeps.c:55 sysdeps/names/sysdeps.c:82
msgid "Load Averange" msgid "Load Averange"
msgstr "અેવરેન્જ બોજો" msgstr "વરેન્જ બોજો"
#: sysdeps/names/sysdeps.c:56 sysdeps/names/sysdeps.c:83 #: sysdeps/names/sysdeps.c:56 sysdeps/names/sysdeps.c:83
msgid "Shared Memory Limits" msgid "Shared Memory Limits"
@@ -1261,11 +1262,11 @@ msgstr "ફાજલ સમય"
#: sysdeps/names/uptime.c:41 #: sysdeps/names/uptime.c:41
msgid "BootTime" msgid "BootTime"
msgstr "BootTime" msgstr "બુટસમય"
#: sysdeps/names/uptime.c:46 #: sysdeps/names/uptime.c:46
msgid "Time in seconds since system boot" msgid "Time in seconds since system boot"
msgstr "સિસ્ટમ શરુ થઇ ત્યારથી સમય સેકડમાં" msgstr "સિસ્ટમ શરુ થઇ ત્યારથી સમય સેકન્ડમાં"
#: sysdeps/names/uptime.c:47 #: sysdeps/names/uptime.c:47
msgid "Time in seconds the system spent in the idle task since system boot" msgid "Time in seconds the system spent in the idle task since system boot"
@@ -1273,7 +1274,7 @@ msgstr "સિસ્ટમ શરુ થઇ ત્યારથી ફાજલ
#: sysdeps/names/uptime.c:48 #: sysdeps/names/uptime.c:48
msgid "Time of last system boot in seconds since the epoch" msgid "Time of last system boot in seconds since the epoch"
msgstr "ઇપોકથી પ્રક્રિયાનો છેલ્લી પ્રક્રિયા શરુ થઈ ત્યારનો સમય સેકડમાં" msgstr "ઇપોકથી પ્રક્રિયાનો છેલ્લી પ્રક્રિયા શરુ થઈ ત્યારનો સમય સેકન્ડમાં"
#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 #: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28
msgid "Hangup" msgid "Hangup"
@@ -1289,7 +1290,7 @@ msgstr "બહાર નીકળો"
#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 #: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31
msgid "Illegal instruction" msgid "Illegal instruction"
msgstr "અસામાન્ય માહિતિ" msgstr "અસામાન્ય માહિત"
#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 #: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32
msgid "Trace trap" msgid "Trace trap"
@@ -1321,7 +1322,7 @@ msgstr "વિભાગનુ ખંડન"
#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 #: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39
msgid "Bad argument to system call" msgid "Bad argument to system call"
msgstr "સિસ્ટમ કાૅલ માટેની ખરાબ દલીલ" msgstr "સિસ્ટમ કલ માટેની ખરાબ દલીલ"
#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 #: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40
msgid "Broken pipe" msgid "Broken pipe"
@@ -1337,7 +1338,7 @@ msgstr "પૂરું કરી રહ્યા છે"
#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 #: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43
msgid "Urgent condition on socket" msgid "Urgent condition on socket"
msgstr "સાૅકેટ પરની તાત્કાલિક શરત" msgstr "સકેટ પરની તાત્કાલિક શરત"
#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 #: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44
msgid "Stop" msgid "Stop"
@@ -1345,7 +1346,7 @@ msgstr "અટકો"
#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 #: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45
msgid "Keyboard stop" msgid "Keyboard stop"
msgstr "કી બાૅર્ડ અટકાવો" msgstr "કી બર્ડ અટકાવો"
#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 #: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46
msgid "Continue" msgid "Continue"
@@ -1385,7 +1386,7 @@ msgstr "રુપરેખાંકિત એલાર્મ ઘડિયાળ"
#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 #: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55
msgid "Window size change" msgid "Window size change"
msgstr "વિન્ડાૅના માપમાં બદલાવ" msgstr "વિન્ડના માપમાં બદલાવ"
#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 #: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56
msgid "Information request" msgid "Information request"

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop\n" "Project-Id-Version: libgtop\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-08-03 14:09+0200\n" "POT-Creation-Date: 2004-09-20 00:04+0200\n"
"PO-Revision-Date: 2004-03-15 21:15+0100\n" "PO-Revision-Date: 2004-09-20 00:05+0200\n"
"Last-Translator: Alessio Frusciante <algol@firenze.linux.it>\n" "Last-Translator: Alessio Frusciante <algol@firenze.linux.it>\n"
"Language-Team: Italian <tp@lists.linux.it>\n" "Language-Team: Italian <tp@lists.linux.it>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -121,39 +121,39 @@ msgid_plural "write %d bytes"
msgstr[0] "scrittura di %d byte" msgstr[0] "scrittura di %d byte"
msgstr[1] "scrittura di %d byte" msgstr[1] "scrittura di %d byte"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "Enable debugging" msgid "Enable debugging"
msgstr "Abilita debug" msgstr "Abilita debug"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:461
msgid "DEBUG" msgid "DEBUG"
msgstr "DEBUG" msgstr "DEBUG"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "Enable verbose output" msgid "Enable verbose output"
msgstr "Abilita output prolisso" msgstr "Abilita output prolisso"
#: src/daemon/gnuserv.c:458 #: src/daemon/gnuserv.c:463
msgid "VERBOSE" msgid "VERBOSE"
msgstr "VERBOSE" msgstr "VERBOSE"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "Don't fork into background" msgid "Don't fork into background"
msgstr "Non fare fork in background" msgstr "Non fare fork in background"
#: src/daemon/gnuserv.c:460 #: src/daemon/gnuserv.c:465
msgid "NO-DAEMON" msgid "NO-DAEMON"
msgstr "NO-DAEMON" msgstr "NO-DAEMON"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "Invoked from inetd" msgid "Invoked from inetd"
msgstr "Invocato da inetd" msgstr "Invocato da inetd"
#: src/daemon/gnuserv.c:462 #: src/daemon/gnuserv.c:467
msgid "INETD" msgid "INETD"
msgstr "INETD" msgstr "INETD"
#: src/daemon/gnuserv.c:496 #: src/daemon/gnuserv.c:501
#, c-format #, c-format
msgid "" msgid ""
"Error on option %s: %s.\n" "Error on option %s: %s.\n"
@@ -260,9 +260,8 @@ msgid "Free file nodes"
msgstr "Nodi file liberi" msgstr "Nodi file liberi"
#: sysdeps/names/fsusage.c:45 sysdeps/names/fsusage.c:55 #: sysdeps/names/fsusage.c:45 sysdeps/names/fsusage.c:55
#, fuzzy
msgid "Block size" msgid "Block size"
msgstr "Bloccato" msgstr "Dimensione blocco"
#: sysdeps/names/fsusage.c:51 #: sysdeps/names/fsusage.c:51
msgid "Free blocks available to the superuser" msgid "Free blocks available to the superuser"
@@ -415,14 +414,12 @@ msgid "MTU"
msgstr "MTU" msgstr "MTU"
#: sysdeps/names/netload.c:48 sysdeps/names/netload.c:69 #: sysdeps/names/netload.c:48 sysdeps/names/netload.c:69
#, fuzzy
msgid "IPv4 Subnet" msgid "IPv4 Subnet"
msgstr "Sottorete" msgstr "Sottorete IPv4"
#: sysdeps/names/netload.c:49 sysdeps/names/netload.c:70 #: sysdeps/names/netload.c:49 sysdeps/names/netload.c:70
#, fuzzy
msgid "IPv4 Address" msgid "IPv4 Address"
msgstr "Indirizzo" msgstr "Indirizzo IPv4"
#: sysdeps/names/netload.c:50 sysdeps/names/netload.c:71 #: sysdeps/names/netload.c:50 sysdeps/names/netload.c:71
msgid "Packets In" msgid "Packets In"
@@ -465,17 +462,16 @@ msgid "Collisions"
msgstr "Collisioni" msgstr "Collisioni"
#: sysdeps/names/netload.c:60 sysdeps/names/netload.c:81 #: sysdeps/names/netload.c:60 sysdeps/names/netload.c:81
#, fuzzy
msgid "IPv6 Address" msgid "IPv6 Address"
msgstr "Indirizzo" msgstr "Indirizzo IPv6"
#: sysdeps/names/netload.c:61 sysdeps/names/netload.c:82 #: sysdeps/names/netload.c:61 sysdeps/names/netload.c:82
msgid "IPv6 Prefix" msgid "IPv6 Prefix"
msgstr "" msgstr "Prefisso IPv6"
#: sysdeps/names/netload.c:62 sysdeps/names/netload.c:83 #: sysdeps/names/netload.c:62 sysdeps/names/netload.c:83
msgid "IPv6 Scope" msgid "IPv6 Scope"
msgstr "" msgstr "Scope IPv6"
#: sysdeps/names/netload.c:68 #: sysdeps/names/netload.c:68
msgid "Maximum Transfer Unit" msgid "Maximum Transfer Unit"

213
po/mk.po
View File

@@ -5,23 +5,23 @@
# translation of mk.po to Macedonian # translation of mk.po to Macedonian
# translation of libgtop.libgtop-GNOME-2-0-port.po to Macedonian # translation of libgtop.libgtop-GNOME-2-0-port.po to Macedonian
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Copyright (C) 2004 THE PACKAGE'S COPYRIGHT HOLDER.
# Ivan Stojmirov <stojmir@linux.net.mk>, 2002,2003 # Ivan Stojmirov <stojmir@linux.net.mk>, 2002,2003.
# Jovan Kostovski <chombium@freemail.com.mk>, 2003 # Jovan Kostovski <chombium@freemail.com.mk>, 2003.
# Глигор Костоски <gigo@ajvar.com.mk>, 2003 # Глигор Костоски <gigo@ajvar.com.mk>, 2003.
# Arangel Angov <ufo@linux.net.mk>, 2004.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libgtop-GNOME-2-0-port.mk\n" "Project-Id-Version: mk\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-08-03 14:09+0200\n" "POT-Creation-Date: 2004-08-03 14:09+0200\n"
"PO-Revision-Date: 2003-06-15 10:09+0200\n" "PO-Revision-Date: 2004-09-21 23:37+0200\n"
"Last-Translator: Ivan Stojmirov <stojmir@linux.net.mk>\n" "Last-Translator: Arangel Angov <ufo@linux.net.mk>\n"
"Language-Team: Macedonian <lug@lists.linux.net.mk>\n" "Language-Team: Macedonian <ossm-members@hedona.on.net.mk>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit"
"X-Generator: KBabel 1.0\n"
#: examples/smp.c:76 #: examples/smp.c:76
#, c-format #, c-format
@@ -105,29 +105,23 @@ msgid "Spin:"
msgstr "Ротација:" msgstr "Ротација:"
#: lib/read.c:65 #: lib/read.c:65
#, fuzzy, c-format #, c-format
msgid "read %d byte" msgid "read %d byte"
msgid_plural "read %d bytes" msgstr "прочитани %d бајт"
msgstr[0] "прочитани %d бајти"
msgstr[1] "прочитани %d бајти"
#: lib/read_data.c:51 #: lib/read_data.c:51
msgid "read data size" msgid "read data size"
msgstr "големина на прочитаните податоци" msgstr "големина на прочитаните податоци"
#: lib/read_data.c:68 #: lib/read_data.c:68
#, fuzzy, c-format #, c-format
msgid "read data %d byte" msgid "read data %d byte"
msgid_plural "read data %d bytes" msgstr "прочитани податоци %d бајти"
msgstr[0] "прочитани %d бајти"
msgstr[1] "прочитани %d бајти"
#: lib/write.c:51 #: lib/write.c:51
#, fuzzy, c-format #, c-format
msgid "write %d byte" msgid "write %d byte"
msgid_plural "write %d bytes" msgstr "запишани %d бајт"
msgstr[0] "запишани %d бајти"
msgstr[1] "запишани %d бајти"
#: src/daemon/gnuserv.c:456 #: src/daemon/gnuserv.c:456
msgid "Enable debugging" msgid "Enable debugging"
@@ -216,7 +210,7 @@ msgstr "Процесорско време за SMP без задачи"
#: sysdeps/names/cpu.c:55 #: sysdeps/names/cpu.c:55
msgid "SMP CPU Flags" msgid "SMP CPU Flags"
msgstr "" msgstr "SMP CPU знаменца"
#: sysdeps/names/cpu.c:60 sysdeps/names/cpu.c:66 #: sysdeps/names/cpu.c:60 sysdeps/names/cpu.c:66
msgid "Number of clock ticks since system boot" msgid "Number of clock ticks since system boot"
@@ -244,7 +238,7 @@ msgstr "Фреквенција на такт (стандардно 100)"
#: sysdeps/names/cpu.c:71 #: sysdeps/names/cpu.c:71
msgid "Bit field indicating which CPU is currently running" msgid "Bit field indicating which CPU is currently running"
msgstr "" msgstr "Поле кое покажува кој процесор работи"
#: sysdeps/names/fsusage.c:40 sysdeps/names/fsusage.c:50 #: sysdeps/names/fsusage.c:40 sysdeps/names/fsusage.c:50
msgid "Total blocks" msgid "Total blocks"
@@ -267,9 +261,8 @@ msgid "Free file nodes"
msgstr "Слободни јазли за датотеки" msgstr "Слободни јазли за датотеки"
#: sysdeps/names/fsusage.c:45 sysdeps/names/fsusage.c:55 #: sysdeps/names/fsusage.c:45 sysdeps/names/fsusage.c:55
#, fuzzy
msgid "Block size" msgid "Block size"
msgstr "Блокиран" msgstr "Големина на блокот"
#: sysdeps/names/fsusage.c:51 #: sysdeps/names/fsusage.c:51
msgid "Free blocks available to the superuser" msgid "Free blocks available to the superuser"
@@ -422,14 +415,12 @@ msgid "MTU"
msgstr "MTU" msgstr "MTU"
#: sysdeps/names/netload.c:48 sysdeps/names/netload.c:69 #: sysdeps/names/netload.c:48 sysdeps/names/netload.c:69
#, fuzzy
msgid "IPv4 Subnet" msgid "IPv4 Subnet"
msgstr "Subnet" msgstr "IPv4 подмрежа"
#: sysdeps/names/netload.c:49 sysdeps/names/netload.c:70 #: sysdeps/names/netload.c:49 sysdeps/names/netload.c:70
#, fuzzy
msgid "IPv4 Address" msgid "IPv4 Address"
msgstr "Адреса" msgstr "IPv4 адреса"
#: sysdeps/names/netload.c:50 sysdeps/names/netload.c:71 #: sysdeps/names/netload.c:50 sysdeps/names/netload.c:71
msgid "Packets In" msgid "Packets In"
@@ -472,17 +463,16 @@ msgid "Collisions"
msgstr "Колизии" msgstr "Колизии"
#: sysdeps/names/netload.c:60 sysdeps/names/netload.c:81 #: sysdeps/names/netload.c:60 sysdeps/names/netload.c:81
#, fuzzy
msgid "IPv6 Address" msgid "IPv6 Address"
msgstr "Адреса" msgstr "IPv6 адреса"
#: sysdeps/names/netload.c:61 sysdeps/names/netload.c:82 #: sysdeps/names/netload.c:61 sysdeps/names/netload.c:82
msgid "IPv6 Prefix" msgid "IPv6 Prefix"
msgstr "" msgstr "Префикс за IPv6"
#: sysdeps/names/netload.c:62 sysdeps/names/netload.c:83 #: sysdeps/names/netload.c:62 sysdeps/names/netload.c:83
msgid "IPv6 Scope" msgid "IPv6 Scope"
msgstr "" msgstr "Опсег на IPv6"
#: sysdeps/names/netload.c:68 #: sysdeps/names/netload.c:68
msgid "Maximum Transfer Unit" msgid "Maximum Transfer Unit"
@@ -682,10 +672,8 @@ msgstr ""
"свопувани" "свопувани"
#: sysdeps/names/procmem.c:63 #: sysdeps/names/procmem.c:63
msgid "" msgid "Current limit in bytes on the rss of the process (usually 2,147,483,647)."
"Current limit in bytes on the rss of the process (usually 2,147,483,647)." msgstr "Моментална граница во бајти на rss на процесот (вообичаено 2,147,483,647)"
msgstr ""
"Моментална граница во бајти на rss на процесот (вообичаено 2,147,483,647)"
#: sysdeps/names/procsegment.c:43 #: sysdeps/names/procsegment.c:43
msgid "Text_RSS" msgid "Text_RSS"
@@ -800,26 +788,24 @@ msgid "GID"
msgstr "GID" msgstr "GID"
#: sysdeps/names/procstate.c:44 #: sysdeps/names/procstate.c:44
#, fuzzy
msgid "RGid" msgid "RGid"
msgstr "Gid" msgstr "RGid"
#: sysdeps/names/procstate.c:44 #: sysdeps/names/procstate.c:44
#, fuzzy
msgid "RUid" msgid "RUid"
msgstr "Uid" msgstr "RUid"
#: sysdeps/names/procstate.c:44 #: sysdeps/names/procstate.c:44
msgid "HasCPU" msgid "HasCPU"
msgstr "" msgstr "Има процесор"
#: sysdeps/names/procstate.c:44 #: sysdeps/names/procstate.c:44
msgid "Proc" msgid "Proc"
msgstr "" msgstr "Proc"
#: sysdeps/names/procstate.c:44 #: sysdeps/names/procstate.c:44
msgid "LProc" msgid "LProc"
msgstr "" msgstr "LProc"
#: sysdeps/names/procstate.c:49 #: sysdeps/names/procstate.c:49
msgid "Basename of executable file in call to exec()" msgid "Basename of executable file in call to exec()"
@@ -838,31 +824,28 @@ msgid "GID of process"
msgstr "GID на процес" msgstr "GID на процес"
#: sysdeps/names/procstate.c:53 #: sysdeps/names/procstate.c:53
#, fuzzy
msgid "Real UID of process" msgid "Real UID of process"
msgstr "UID на процес" msgstr "Вистински UID на процесот"
#: sysdeps/names/procstate.c:54 #: sysdeps/names/procstate.c:54
#, fuzzy
msgid "Real GID of process" msgid "Real GID of process"
msgstr "GID на процес" msgstr "Вистински GID на процесот"
#: sysdeps/names/procstate.c:55 #: sysdeps/names/procstate.c:55
msgid "Has CPU" msgid "Has CPU"
msgstr "" msgstr "Има процесор"
#: sysdeps/names/procstate.c:56 #: sysdeps/names/procstate.c:56
#, fuzzy
msgid "Processor" msgid "Processor"
msgstr "ИД на процесот" msgstr "Процесор"
#: sysdeps/names/procstate.c:57 #: sysdeps/names/procstate.c:57
msgid "Last Processor" msgid "Last Processor"
msgstr "" msgstr "Последен процесор"
#: sysdeps/names/proctime.c:45 #: sysdeps/names/proctime.c:45
msgid "Start_Time" msgid "Start_Time"
msgstr "Start_Time" msgstr "Почетно време"
#: sysdeps/names/proctime.c:45 #: sysdeps/names/proctime.c:45
msgid "RTime" msgid "RTime"
@@ -890,7 +873,7 @@ msgstr "TimeOut"
#: sysdeps/names/proctime.c:46 #: sysdeps/names/proctime.c:46
msgid "It_Real_Value" msgid "It_Real_Value"
msgstr "It_Real_Value" msgstr "Реална вредност"
#: sysdeps/names/proctime.c:47 #: sysdeps/names/proctime.c:47
msgid "Frequency" msgid "Frequency"
@@ -906,7 +889,7 @@ msgstr "XCPU_STime"
#: sysdeps/names/proctime.c:52 #: sysdeps/names/proctime.c:52
msgid "Start time of process in seconds since the epoch" msgid "Start time of process in seconds since the epoch"
msgstr "Стартно време на процесот од во секунди од epoch" msgstr "Почетно време на процесот од во секунди од епохата"
#: sysdeps/names/proctime.c:53 #: sysdeps/names/proctime.c:53
msgid "Real time accumulated by process (should be utime + stime)" msgid "Real time accumulated by process (should be utime + stime)"
@@ -918,19 +901,19 @@ msgstr "Кориснични режим, процесорско време ак
#: sysdeps/names/proctime.c:55 #: sysdeps/names/proctime.c:55
msgid "kernel-mode CPU time accumulated by process" msgid "kernel-mode CPU time accumulated by process"
msgstr "Кернел режим, процесорско време акумулирано од процесот" msgstr "Режим на кернелот, процесорското време акумулирано од процесот"
#: sysdeps/names/proctime.c:56 #: sysdeps/names/proctime.c:56
msgid "cumulative utime of process and reaped children" msgid "cumulative utime of process and reaped children"
msgstr "Вкупно utime на процесот собрано со времето од децата" msgstr "cumulative utime of process and reaped children"
#: sysdeps/names/proctime.c:57 #: sysdeps/names/proctime.c:57
msgid "cumulative stime of process and reaped children" msgid "cumulative stime of process and reaped children"
msgstr "Вкупно stime на процесот собрано со времето од децата" msgstr "cumulative stime of process and reaped children"
#: sysdeps/names/proctime.c:58 #: sysdeps/names/proctime.c:58
msgid "The time (in jiffies) of the process's next timeout" msgid "The time (in jiffies) of the process's next timeout"
msgstr "Време (во jiffies) за следниот тајмаут на процесот" msgstr "Време (во jiffies) за следното истекување на процесот"
#: sysdeps/names/proctime.c:59 #: sysdeps/names/proctime.c:59
msgid "" msgid ""
@@ -969,24 +952,20 @@ msgid "EGid"
msgstr "EGid" msgstr "EGid"
#: sysdeps/names/procuid.c:48 #: sysdeps/names/procuid.c:48
#, fuzzy
msgid "SUid" msgid "SUid"
msgstr "Uid" msgstr "SUid"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
#, fuzzy
msgid "SGid" msgid "SGid"
msgstr "Gid" msgstr "SGid"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
#, fuzzy
msgid "FSUid" msgid "FSUid"
msgstr "Uid" msgstr "FSUid"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
#, fuzzy
msgid "FSGid" msgid "FSGid"
msgstr "Gid" msgstr "FSGid"
#: sysdeps/names/procuid.c:49 #: sysdeps/names/procuid.c:49
msgid "Pid" msgid "Pid"
@@ -1017,66 +996,60 @@ msgid "Priority"
msgstr "Приоритет" msgstr "Приоритет"
#: sysdeps/names/procuid.c:51 #: sysdeps/names/procuid.c:51
#, fuzzy
msgid "NGroups" msgid "NGroups"
msgstr "Група ИД" msgstr "NGroups"
#: sysdeps/names/procuid.c:51 #: sysdeps/names/procuid.c:51
#, fuzzy
msgid "Groups" msgid "Groups"
msgstr "Група ИД" msgstr "Групи"
#: sysdeps/names/procuid.c:56 #: sysdeps/names/procuid.c:56
msgid "User ID" msgid "User ID"
msgstr "ID на Корисник" msgstr "ID на корисник"
#: sysdeps/names/procuid.c:57 #: sysdeps/names/procuid.c:57
msgid "Effective User ID" msgid "Effective User ID"
msgstr "Корисничко име" msgstr "Ефективен кориснички ID"
#: sysdeps/names/procuid.c:58 #: sysdeps/names/procuid.c:58
msgid "Group ID" msgid "Group ID"
msgstr "Група ИД" msgstr "ID на група"
#: sysdeps/names/procuid.c:59 #: sysdeps/names/procuid.c:59
msgid "Effective Group ID" msgid "Effective Group ID"
msgstr "ID на ефективна Група" msgstr "ID на ефективна Група"
#: sysdeps/names/procuid.c:60 #: sysdeps/names/procuid.c:60
#, fuzzy
msgid "Set User ID" msgid "Set User ID"
msgstr "ID на Корисник" msgstr "Поставете ID за корисникот"
#: sysdeps/names/procuid.c:61 #: sysdeps/names/procuid.c:61
#, fuzzy
msgid "Set Group ID" msgid "Set Group ID"
msgstr "Група ИД" msgstr "Поставете ID на група"
#: sysdeps/names/procuid.c:62 #: sysdeps/names/procuid.c:62
#, fuzzy
msgid "Filesystem User ID" msgid "Filesystem User ID"
msgstr "Искористеност на фајл системот" msgstr "Кориснички ID на датотечниот систем"
#: sysdeps/names/procuid.c:63 #: sysdeps/names/procuid.c:63
#, fuzzy
msgid "Filesystem Group ID" msgid "Filesystem Group ID"
msgstr "ID на ефективна Група" msgstr "Групен ID на датотечниот систем"
#: sysdeps/names/procuid.c:64 #: sysdeps/names/procuid.c:64
msgid "Process ID" msgid "Process ID"
msgstr "ИД на процесот" msgstr "ID на процесот"
#: sysdeps/names/procuid.c:65 #: sysdeps/names/procuid.c:65
msgid "PID of parent process" msgid "PID of parent process"
msgstr "ИД на родителскиот процес" msgstr "ID на родителскиот процес"
#: sysdeps/names/procuid.c:66 #: sysdeps/names/procuid.c:66
msgid "Process group ID" msgid "Process group ID"
msgstr "ИД на групата" msgstr "ID на групата"
#: sysdeps/names/procuid.c:67 #: sysdeps/names/procuid.c:67
msgid "Session ID" msgid "Session ID"
msgstr "ИД на сесијата" msgstr "ID на сесијата"
#: sysdeps/names/procuid.c:68 #: sysdeps/names/procuid.c:68
msgid "Full device number of controlling terminal" msgid "Full device number of controlling terminal"
@@ -1092,17 +1065,15 @@ msgstr "Кернел приоритет при распоредување"
#: sysdeps/names/procuid.c:71 #: sysdeps/names/procuid.c:71
msgid "Standard unix nice level of process" msgid "Standard unix nice level of process"
msgstr "Стандардно Unix ниво на процеси" msgstr "Стандардно јуникс ниво на процеси"
#: sysdeps/names/procuid.c:72 #: sysdeps/names/procuid.c:72
#, fuzzy
msgid "Number of additional process groups" msgid "Number of additional process groups"
msgstr "ID на група терминални процеси" msgstr "Број на додатни групи за процеси"
#: sysdeps/names/procuid.c:73 #: sysdeps/names/procuid.c:73
#, fuzzy
msgid "Array of additional process groups" msgid "Array of additional process groups"
msgstr "ID на група терминални процеси" msgstr "Низа на додатни групи за процеси"
#: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57 #: sysdeps/names/sem_limits.c:43 sysdeps/names/sem_limits.c:57
msgid "Number of entries in semaphore map" msgid "Number of entries in semaphore map"
@@ -1166,15 +1137,15 @@ msgstr "Максимална големина на поделена мемори
#: sysdeps/names/swap.c:40 sysdeps/names/swap.c:49 #: sysdeps/names/swap.c:40 sysdeps/names/swap.c:49
msgid "Total Swap Space" msgid "Total Swap Space"
msgstr "Вкупно Swap простор" msgstr "Вкупен swap простор"
#: sysdeps/names/swap.c:41 sysdeps/names/swap.c:50 #: sysdeps/names/swap.c:41 sysdeps/names/swap.c:50
msgid "Used Swap Space" msgid "Used Swap Space"
msgstr "Искористен Swap простор" msgstr "Искористен swap простор"
#: sysdeps/names/swap.c:42 sysdeps/names/swap.c:51 #: sysdeps/names/swap.c:42 sysdeps/names/swap.c:51
msgid "Free Swap Space" msgid "Free Swap Space"
msgstr "Слободен Swap простор" msgstr "Слободен swap простор"
#: sysdeps/names/swap.c:43 #: sysdeps/names/swap.c:43
msgid "Page In" msgid "Page In"
@@ -1301,9 +1272,8 @@ msgid "Idletime"
msgstr "Време на неактивност" msgstr "Време на неактивност"
#: sysdeps/names/uptime.c:41 #: sysdeps/names/uptime.c:41
#, fuzzy
msgid "BootTime" msgid "BootTime"
msgstr "RTime" msgstr "При подигнување"
#: sysdeps/names/uptime.c:46 #: sysdeps/names/uptime.c:46
msgid "Time in seconds since system boot" msgid "Time in seconds since system boot"
@@ -1311,13 +1281,11 @@ msgstr "Време во секунди од последното бутирањ
#: sysdeps/names/uptime.c:47 #: sysdeps/names/uptime.c:47
msgid "Time in seconds the system spent in the idle task since system boot" msgid "Time in seconds the system spent in the idle task since system boot"
msgstr "" msgstr "Време во секунди што поминале за неактивна задача од последното бутирање"
"Време во секунди што поминале за неактивна задача од последното бутирање"
#: sysdeps/names/uptime.c:48 #: sysdeps/names/uptime.c:48
#, fuzzy
msgid "Time of last system boot in seconds since the epoch" msgid "Time of last system boot in seconds since the epoch"
msgstr "Стартно време на процесот од во секунди од epoch" msgstr "Времето од последното подигнување на системот во секунди од епохата"
#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 #: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28
msgid "Hangup" msgid "Hangup"
@@ -1329,7 +1297,7 @@ msgstr "Прекин"
#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 #: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30
msgid "Quit" msgid "Quit"
msgstr "Напушти" msgstr "Излез"
#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 #: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31
msgid "Illegal instruction" msgid "Illegal instruction"
@@ -1443,44 +1411,3 @@ msgstr "Сигнал 1 дефиниран од корисникот"
msgid "User defined signal 2" msgid "User defined signal 2"
msgstr "Сигнал 2 дефиниран од корисникот" msgstr "Сигнал 2 дефиниран од корисникот"
#~ msgid "Unknown system error"
#~ msgstr "Непозната системска грешка"
#~ msgid "%s: option `%s' is ambiguous\n"
#~ msgstr "%s: опцијата s %s e премногу општ\n"
#~ msgid "%s: option `--%s' doesn't allow an argument\n"
#~ msgstr "%s: опцијa. --%s не дозволува аргументи\n"
#~ msgid "%s: option `%c%s' doesn't allow an argument\n"
#~ msgstr "%s: опцијa. --%c%s не дозволува аргументи\n"
#~ msgid "%s: option `%s' requires an argument\n"
#~ msgstr "%s: опцијa. --%s бара аргументи\n"
#~ msgid "%s: unrecognized option `--%s'\n"
#~ msgstr "%s: непрепознаена опција --%s\n"
#~ msgid "%s: unrecognized option `%c%s'\n"
#~ msgstr "%s: непрепознаена опција --%c%s\n"
#~ msgid "%s: illegal option -- %c\n"
#~ msgstr "%s: невалидна опција --%c\n"
#~ msgid "%s: invalid option -- %c\n"
#~ msgstr "%s: невалидна опција --%c\n"
#~ msgid "%s: option requires an argument -- %c\n"
#~ msgstr "%s: опцијaбара аргументи --%c \n"
#~ msgid "%s: option `-W %s' is ambiguous\n"
#~ msgstr "%s опција W %s е премногу општа\n"
#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
#~ msgstr "%s опција W %s не дозволува аргументи\n"
#~ msgid "Show this help message"
#~ msgstr "Прикажи ја оваа порака за помош"
#~ msgid "Display brief usage message"
#~ msgstr "Прикажи помош за користење"

1405
po/or.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,9 @@
2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* gnuserv.c: (setup_table): 'screen' is only defined when AUTH_MAGIC_COOKIE
is defined.
Added missing initializers for popt options.
2004-05-25 Benoît Dejean <tazforever@dlfp.org> 2004-05-25 Benoît Dejean <tazforever@dlfp.org>
* gnuserv.c: (permitted): Cast to size_t to remove warning. * gnuserv.c: (permitted): Cast to size_t to remove warning.

View File

@@ -274,7 +274,12 @@ permitted (u_long host_addr, int fd)
static int static int
setup_table (void) setup_table (void)
{ {
char hostname [HOSTNAMSZ], screen [BUFSIZ]; char hostname [HOSTNAMSZ];
#ifdef AUTH_MAGIC_COOKIE
char screen [BUFSIZ];
#endif
long host_addr; long host_addr;
int i, hosts = 0; int i, hosts = 0;
@@ -460,7 +465,7 @@ const struct poptOption popt_options [] = {
N_("Don't fork into background"), N_("NO-DAEMON") }, N_("Don't fork into background"), N_("NO-DAEMON") },
{ "inetd", 'i', POPT_ARG_NONE, &invoked_from_inetd, 0, { "inetd", 'i', POPT_ARG_NONE, &invoked_from_inetd, 0,
N_("Invoked from inetd"), N_("INETD") }, N_("Invoked from inetd"), N_("INETD") },
{ NULL, '\0', 0, NULL, 0 } { NULL, '\0', 0, NULL, 0, NULL, NULL }
}; };
int int

View File

@@ -1,3 +1,51 @@
2004-10-22 Benoît Dejean <tazforever@dlfp.org>
* procargs.c: (glibtop_get_proc_args_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):
* procstate.c: (glibtop_get_proc_state_s):
* proctime.c: (glibtop_get_proc_time_s):
* procuid.c: (glibtop_get_proc_uid_s): No longer abort() is no such pid.
buf.flags == 0ULL means that there no data could be retrieve at all.
Closes #154876. Thanks to Christophe Belle.
2004-10-04 Benoît Dejean <tazforever@dlfp.org>
* procstate.c: (glibtop_get_proc_state_s): Fixed .state to follow
LibGTop2 specification.
2004-10-04 Benoît Dejean <tazforever@dlfp.org>
* procmap.c: (glibtop_get_proc_map_s): Fixed glibtop_init_s call.
2004-10-04 Benoît Dejean <tazforever@dlfp.org>
* Makefile.am:
* cpu.c: (glibtop_init_cpu_p), (glibtop_get_cpu_p):
* glibtop_machine.h:
* glibtop_server.h:
* mem.c: (glibtop_get_mem_s):
* netload.c: (glibtop_get_netload_p):
* procargs.c: (glibtop_get_proc_args_s):
* prockernel.c: (glibtop_get_proc_kernel_s):
* proclist.c: (glibtop_get_proclist_s):
* procmem.c: (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_get_proc_segment_s):
* procsignal.c: (glibtop_get_proc_signal_s):
* procstate.c: (glibtop_get_proc_state_s):
* proctime.c: (glibtop_get_proc_time_s):
* procuid.c: (glibtop_get_proc_uid_s):
* swap.c: (glibtop_get_swap_s):
* sysinfo.c: (add_info), (init_sysinfo):
* uptime.c: (glibtop_init_uptime_s), (glibtop_get_uptime_s):
AIX support updated by Laurent Vivier <Laurent.Vivier@BULL.NET>.
Fixed cpu/uptime/sysinfo.
Added missing calls to glibtop_init_s.
2004-06-13 Benoît Dejean <tazforever@dlfp.org> 2004-06-13 Benoît Dejean <tazforever@dlfp.org>
* sysinfo.c: Added missing const qualifier. * sysinfo.c: Added missing const qualifier.

View File

@@ -3,16 +3,18 @@ INCLUDES = @INCLUDES@
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la
libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c mem.c swap.c uptime.c \
procargs.c prockernel.c proclist.c procmap.c \
procmem.c procsegment.c procsignal.c \
proctime.c procuid.c procmem.c utils.c \
procstate.c sysinfo.c
libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c loadavg.c \
uptime.c loadavg.c shm_limits.c msg_limits.c \ msg_limits.c shm_limits.c sem_limits.c \
sem_limits.c proclist.c procstate.c procuid.c \ netload.c ppp.c utils.c
proctime.c procmem.c procsignal.c prockernel.c \
procsegment.c procargs.c procmap.c netload.c \
ppp.c utils.c utils.h sysinfo.c
libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtop_sysdeps_suid_2_0_la_LIBADD = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la $(GLIB_LIBS) libgtop_sysdeps_suid_2_0_la_LIBADD = $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la $(GLIB_LIBS)

View File

@@ -52,6 +52,13 @@ glibtop_init_cpu_p (glibtop *server)
server->ncpu = 0; /* means single-processor, see glibtop.h */ server->ncpu = 0; /* means single-processor, see glibtop.h */
} }
result = _glibtop_get_kmem_offset(server, "sysinfo");
if (result == -1)
{
return;
}
server->machine.sysinfo_offset = result;
result = _glibtop_get_kmem_offset(server, "cpuinfo"); result = _glibtop_get_kmem_offset(server, "cpuinfo");
if (result == -1) if (result == -1)
{ {
@@ -73,11 +80,27 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
{ {
int result; int result;
int cpu; int cpu;
struct sysinfo sysinfo;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0); glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_CPU), 0);
memset (buf, 0, sizeof (glibtop_cpu)); memset (buf, 0, sizeof (glibtop_cpu));
result = _glibtop_get_kmem_info(server, server->machine.sysinfo_offset,
&sysinfo, sizeof(struct sysinfo));
if (result <= 0)
{
glibtop_error_io_r (server, "Cannot read sysinfo");
return;
}
buf->idle = sysinfo.cpu[CPU_IDLE];
buf->user = sysinfo.cpu[CPU_USER];
buf->sys = sysinfo.cpu[CPU_KERNEL];
buf->nice = sysinfo.cpu[CPU_WAIT];
buf->total = buf->idle + buf->user + buf->sys + buf->nice ;
result = _glibtop_get_kmem_info(server, server->machine.cpuinfo_offset, result = _glibtop_get_kmem_info(server, server->machine.cpuinfo_offset,
server->machine.cpuinfo, server->machine.cpuinfo,
_system_configuration.ncpus _system_configuration.ncpus
@@ -89,13 +112,8 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
return; return;
} }
buf->idle = 0;
buf->user = 0; for (cpu = 0; cpu < MIN(GLIBTOP_NCPU, _system_configuration.ncpus); cpu++)
buf->sys = 0;
buf->nice = 0;
for (cpu = 0; cpu < _system_configuration.ncpus; cpu++)
{
if (cpu < GLIBTOP_NCPU)
{ {
buf->xcpu_idle[cpu] = buf->xcpu_idle[cpu] =
server->machine.cpuinfo[cpu].cpu[CPU_IDLE]; server->machine.cpuinfo[cpu].cpu[CPU_IDLE];
@@ -112,13 +130,6 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
buf->xcpu_nice[cpu]; buf->xcpu_nice[cpu];
} }
buf->idle += server->machine.cpuinfo[cpu].cpu[CPU_IDLE];
buf->user += server->machine.cpuinfo[cpu].cpu[CPU_USER];
buf->sys += server->machine.cpuinfo[cpu].cpu[CPU_KERNEL];
buf->nice += server->machine.cpuinfo[cpu].cpu[CPU_WAIT];
buf->total = buf->idle + buf->user + buf->sys + buf->nice ;
}
buf->frequency = sysconf(_SC_CLK_TCK); buf->frequency = sysconf(_SC_CLK_TCK);
buf->flags = _glibtop_sysdeps_cpu; buf->flags = _glibtop_sysdeps_cpu;

View File

@@ -38,6 +38,7 @@ struct _glibtop_machine
int kmem_fd; int kmem_fd;
off_t cpuinfo_offset; off_t cpuinfo_offset;
off_t sysinfo_offset;
off_t ifnet_offset; off_t ifnet_offset;
off_t loadavg_offset; off_t loadavg_offset;
off_t shminfo_offset; off_t shminfo_offset;

View File

@@ -29,7 +29,7 @@ G_BEGIN_DECLS
#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) #define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU)
#define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_MEM 0
#define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_SWAP 0
#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) #define GLIBTOP_SUID_UPTIME 0
#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) #define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG)
#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) #define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS)
#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) #define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS)

View File

@@ -49,6 +49,8 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
int pagesize; int pagesize;
int result; int result;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_MEM), 0);
memset (buf, 0, sizeof (glibtop_mem)); memset (buf, 0, sizeof (glibtop_mem));
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -119,6 +119,8 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
long mask; long mask;
char name[16]; char name[16];
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0);
memset (buf, 0, sizeof (glibtop_netload)); memset (buf, 0, sizeof (glibtop_netload));
for ( offset = server->machine.ifnet_offset; for ( offset = server->machine.ifnet_offset;

View File

@@ -62,15 +62,12 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
int result; int result;
int len; int len;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0);
memset (buf, 0, sizeof (glibtop_proc_args)); memset (buf, 0, sizeof (glibtop_proc_args));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return NULL;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return NULL;
}
size = max_len != 0 ? max_len : 4096; size = max_len != 0 ? max_len : 4096;
args_buffer = g_malloc (size); args_buffer = g_malloc (size);

View File

@@ -57,15 +57,12 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf,
tid_t thid; tid_t thid;
int result; int result;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
memset (buf, 0, sizeof (glibtop_proc_kernel)); memset (buf, 0, sizeof (glibtop_proc_kernel));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r(server, "Cannot read procsinfo");
return;
}
if (!(pinfo->pi_flags | SKPROC)) if (!(pinfo->pi_flags | SKPROC))
{ {

View File

@@ -59,6 +59,8 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
pid_t current; pid_t current;
int result; int result;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0);
memset (buf, 0, sizeof (glibtop_proclist)); memset (buf, 0, sizeof (glibtop_proclist));
for( count = total = 0, current = 0 for( count = total = 0, current = 0

View File

@@ -41,7 +41,7 @@ glibtop_init_proc_map_s (glibtop *server)
glibtop_map_entry * glibtop_map_entry *
glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
{ {
glibtop_init_p (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0); glibtop_init_p (&server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0);
memset (buf, 0, sizeof (glibtop_proc_map)); memset (buf, 0, sizeof (glibtop_proc_map));

View File

@@ -53,15 +53,12 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf,
struct procsinfo *pinfo; struct procsinfo *pinfo;
int pagesize; int pagesize;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0);
memset (buf, 0, sizeof (glibtop_proc_mem)); memset (buf, 0, sizeof (glibtop_proc_mem));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -53,15 +53,12 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
struct procsinfo *pinfo; struct procsinfo *pinfo;
int pagesize; int pagesize;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
memset (buf, 0, sizeof (glibtop_proc_segment)); memset (buf, 0, sizeof (glibtop_proc_segment));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -54,15 +54,12 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
int i; int i;
long bit; long bit;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
memset (buf, 0, sizeof (glibtop_proc_signal)); memset (buf, 0, sizeof (glibtop_proc_signal));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
/* pending signals */ /* pending signals */

View File

@@ -53,15 +53,12 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
tid_t thid; tid_t thid;
int result; int result;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
memset (buf, 0, sizeof (glibtop_proc_state)); memset (buf, 0, sizeof (glibtop_proc_state));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r(server, "Cannot read procsinfo");
return;
}
if (pinfo->pi_pid == 0) if (pinfo->pi_pid == 0)
{ {
@@ -82,7 +79,7 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
if (pinfo->pi_state == SZOMB) if (pinfo->pi_state == SZOMB)
{ {
buf->state = 'Z'; buf->state = GLIBTOP_PROCESS_ZOMBIE;
strcpy(buf->cmd, "<defunct>"); strcpy(buf->cmd, "<defunct>");
} }
else else
@@ -99,23 +96,24 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
switch (thinfo.ti_state) switch (thinfo.ti_state)
{ {
case TSIDL: case TSIDL:
buf->state = 'D'; /* FIXME */
/* buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; */
break; break;
case TSRUN: case TSRUN:
buf->state = 'R'; buf->state = GLIBTOP_PROCESS_RUNNING;
break; break;
case TSSLEEP: case TSSLEEP:
buf->state = 'S'; buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE;
break; break;
case TSZOMB: case TSZOMB:
buf->state = 'Z'; buf->state = GLIBTOP_PROCESS_ZOMBIE;
strcpy(buf->cmd, "<defunct>"); strcpy(buf->cmd, "<defunct>");
break; break;
case TSSTOP: case TSSTOP:
buf->state = 'T'; buf->state = GLIBTOP_PROCESS_STOPPED;
break; break;
case TSSWAP: case TSSWAP:
buf->state = 'W'; buf->state = GLIBTOP_PROCESS_SWAPPING;
break; break;
default: default:
buf->state = 0; buf->state = 0;

View File

@@ -51,14 +51,12 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
{ {
struct procsinfo *pinfo; struct procsinfo *pinfo;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
memset (buf, 0, sizeof (glibtop_proc_time)); memset (buf, 0, sizeof (glibtop_proc_time));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
buf->start_time = pinfo->pi_start; buf->start_time = pinfo->pi_start;
buf->utime = pinfo->pi_ru.ru_utime.tv_sec + (double)pinfo->pi_ru.ru_utime.tv_usec/1000000.0; buf->utime = pinfo->pi_ru.ru_utime.tv_sec + (double)pinfo->pi_ru.ru_utime.tv_usec/1000000.0;

View File

@@ -59,15 +59,12 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf,
tid_t thid; tid_t thid;
int result; int result;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
memset (buf, 0, sizeof (glibtop_proc_uid)); memset (buf, 0, sizeof (glibtop_proc_uid));
pinfo = _glibtop_get_procinfo(server, pid); pinfo = _glibtop_get_procinfo(server, pid);
if (pinfo == NULL) if (pinfo == NULL) return;
{
glibtop_error_io_r (server, "Cannot read procsinfo");
return;
}
buf->uid = pinfo->pi_cred.cr_ruid; buf->uid = pinfo->pi_cred.cr_ruid;
buf->euid = pinfo->pi_cred.cr_uid; buf->euid = pinfo->pi_cred.cr_uid;

View File

@@ -57,6 +57,8 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
int comment = 0; int comment = 0;
int pos = 0; int pos = 0;
glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_SWAP), 0);
memset (buf, 0, sizeof (glibtop_swap)); memset (buf, 0, sizeof (glibtop_swap));
pagesize = sysconf(_SC_PAGESIZE); pagesize = sysconf(_SC_PAGESIZE);

View File

@@ -31,10 +31,16 @@ static const unsigned long _glibtop_sysdeps_sysinfo =
static glibtop_sysinfo sysinfo; static glibtop_sysinfo sysinfo;
static void add_info(glibtop_entry* entry, char* label, char* value) static void add_info(glibtop_entry* entry, char* label, char* attribute)
{ {
g_ptr_array_add(entry->labels, g_strdup(label)); char* key;
g_hash_table_insert(entry->values, label, g_strdup(value)); char* value;
key = g_strdup(label);
value = g_strdup(attribute);
g_ptr_array_add(entry->labels, key);
g_hash_table_insert(entry->values, key, value);
} }
static void init_sysinfo(void) static void init_sysinfo(void)
@@ -60,22 +66,22 @@ static void init_sysinfo(void)
case POWER_RS: case POWER_RS:
add_info( &sysinfo.cpuinfo[cpu] add_info( &sysinfo.cpuinfo[cpu]
, "architecture" , "architecture"
, "Power Classic architecture"); , "Power Classic");
break; break;
case POWER_PC: case POWER_PC:
add_info( &sysinfo.cpuinfo[cpu] add_info( &sysinfo.cpuinfo[cpu]
, "architecture" , "architecture"
, "Power PC architecture"); , "Power PC");
break; break;
case IA64: case IA64:
add_info( &sysinfo.cpuinfo[cpu] add_info( &sysinfo.cpuinfo[cpu]
, "architecture" , "architecture"
, "Intel IA64 architecture"); , "Intel IA64");
break; break;
default: default:
add_info( &sysinfo.cpuinfo[cpu] add_info( &sysinfo.cpuinfo[cpu]
, "architecture" , "architecture"
, "Unknown architecture"); , "Unknown");
break; break;
} }
@@ -161,7 +167,7 @@ static void init_sysinfo(void)
sprintf(buf,"%d", _system_configuration.width); sprintf(buf,"%d", _system_configuration.width);
add_info( &sysinfo.cpuinfo[cpu], "width", buf); add_info( &sysinfo.cpuinfo[cpu], "width", buf);
if (_system_configuration.cache_attrib & (1 << 31)) if (_system_configuration.cache_attrib & 1 )
{ {
/* L1 cache is present */ /* L1 cache is present */

View File

@@ -21,6 +21,8 @@
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#include <sys/times.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/error.h> #include <glibtop/error.h>
#include <glibtop/uptime.h> #include <glibtop/uptime.h>
@@ -32,16 +34,13 @@
#include <time.h> #include <time.h>
static const unsigned long _glibtop_sysdeps_uptime = static const unsigned long _glibtop_sysdeps_uptime =
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME); (1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_BOOT_TIME);
static const unsigned long _required_cpu_flags =
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) +
(1L << GLIBTOP_CPU_FREQUENCY);
/* Init function. */ /* Init function. */
void void
glibtop_init_uptime_p (glibtop *server) glibtop_init_uptime_s (glibtop *server)
{ {
server->sysdeps.uptime = _glibtop_sysdeps_uptime; server->sysdeps.uptime = _glibtop_sysdeps_uptime;
} }
@@ -49,28 +48,17 @@ glibtop_init_uptime_p (glibtop *server)
/* Provides uptime and idle time. */ /* Provides uptime and idle time. */
void void
glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
{ {
glibtop_cpu cpu; time_t uptime;
struct tms tbuf;
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); glibtop_init_s (&server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0);
memset (buf, 0, sizeof (glibtop_uptime)); memset (buf, 0, sizeof (glibtop_uptime));
/* We simply calculate it from the CPU usage. */ buf->uptime = (double)times(&tbuf) / (double)sysconf(_SC_CLK_TCK);
glibtop_get_cpu_p (server, &cpu);
/* Make sure all required fields are present. */
if ((cpu.flags & _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->boot_time = (guint64) time(NULL) - (guint64) buf->uptime; buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime; buf->flags = _glibtop_sysdeps_uptime;
} }

View File

@@ -1,3 +1,54 @@
2004-12-09 Benoît Dejean <tazforever@dlfp.org>
* mountlist.c: (ignore_mount_entry): Ignores "unkown" file system type.
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (glibtop_get_fsusage_s): Fixed .block_size on Solaris.
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
* Makefile.am:
* mountlist.c:
* mountlist.h: Removed mountlist.h.
2004-09-23 Benoît Dejean <tazforever@dlfp.org>
* mountlist.c: (ignore_mount_entry): Added openpromfs.
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (glibtop_get_fsusage_s): Linux: Sanitize. Removed calls
to obfuscated PROPAGATE_ALL_ONES(x) which seems to return unpredictable
values on some arch (e.g sparc).
Closes #153141.
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
* mountlist.c: (ignore_mount_entry): Added mntfs to ignore list.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (_glibtop_get_fsusage_read_write),
(glibtop_get_fsusage_s):
* mountlist.c: (glibtop_get_mountlist_s): Back to previous version.
2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (_glibtop_get_fsusage_read_write) : Added new flag.
(_glibtop_get_fsusage_read_write): Changed prototype. Returns TRUE on
success, then _glibtop_get_fsusage_read_write is set.
Added comment to locate Linux code.
* mountlist.c: (read_filesystem_list): Dropped unused need_fs_type parameter.
This is now default.
Fixed possible leak.
(ignore_mount_entry): Added "usbfs" to ignored FS.
(glibtop_get_mountlist_s): Updated.
2004-08-22 Benoît Dejean <tazforever@dlfp.org> 2004-08-22 Benoît Dejean <tazforever@dlfp.org>
* mountlist.c: (read_filesystem_list): Merged FreeBSD Marcus' patch. * mountlist.c: (read_filesystem_list): Merged FreeBSD Marcus' patch.

View File

@@ -15,7 +15,7 @@ noinst_LTLIBRARIES = libgtop_common-2.0.la libgtop_suid_common-2.0.la
libgtop_common_2_0_la_SOURCES = error.c gnuslib.c \ libgtop_common_2_0_la_SOURCES = error.c gnuslib.c \
fsusage.c \ fsusage.c \
mountlist.c mountlist.h \ mountlist.c \
procargs.c \ procargs.c \
$(inodedb_SRCLIST) $(inodedb_SRCLIST)

View File

@@ -129,7 +129,7 @@ glibtop_warn_io_r (glibtop *server, char *format, ...)
va_end (args); va_end (args);
} }
#ifndef __GNUC__ #if !defined(__GNUC__) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
void void
glibtop_error (char *format, ...) glibtop_error (char *format, ...)
@@ -167,4 +167,4 @@ glibtop_warn_io (char *format, ...)
va_end (args); va_end (args);
} }
#endif /* __GNUC__ */ #endif /* !defined(__GNUC__) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) */

View File

@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
@@ -26,26 +26,26 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#if HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
# include <limits.h> # include <limits.h>
#endif #endif
#ifndef CHAR_BIT #ifndef CHAR_BIT
# define CHAR_BIT 8 # define CHAR_BIT 8
#endif #endif
#if HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#if HAVE_SYS_MOUNT_H #ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h> # include <sys/mount.h>
#endif #endif
#if HAVE_SYS_VFS_H #ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h> # include <sys/vfs.h>
#endif #endif
#if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */ #ifdef HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
# include <sys/fs/s5param.h> # include <sys/fs/s5param.h>
#endif #endif
@@ -53,21 +53,21 @@
# include <sys/filsys.h> /* SVR2 */ # include <sys/filsys.h> /* SVR2 */
#endif #endif
#if HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
# include <fcntl.h> # include <fcntl.h>
#endif #endif
#if HAVE_SYS_STATFS_H #ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h> # include <sys/statfs.h>
#endif #endif
#if HAVE_DUSTAT_H /* AIX PS/2 */ #ifdef HAVE_DUSTAT_H /* AIX PS/2 */
# include <sys/dustat.h> # include <sys/dustat.h>
#endif #endif
#if HAVE_SYS_STATVFS_H /* SVR4 */ #ifdef HAVE_SYS_STATVFS_H /* SVR4 */
# include <sys/statvfs.h> # include <sys/statvfs.h>
int statvfs (); int statvfs (const char *path, struct statvfs *buf);
#endif #endif
/* Many space usage primitives use all 1 bits to denote a value that is /* Many space usage primitives use all 1 bits to denote a value that is
@@ -109,7 +109,6 @@ static const unsigned long _glibtop_sysdeps_fsusage =
+ (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE); + (1L << GLIBTOP_FSUSAGE_FFREE) + (1L << GLIBTOP_FSUSAGE_BLOCK_SIZE);
/* /*
* _glibtop_get_fsusage_read_write * _glibtop_get_fsusage_read_write
* New function to retrieve total read and write * New function to retrieve total read and write
@@ -136,7 +135,13 @@ void _glibtop_linux_get_fsusage_read_write(glibtop *server,
#else /* default fallback */ #else /* default fallback */
#warning glibtop_get_fsusage .read .write are not implemented. #warning glibtop_get_fsusage .read .write are not implemented.
#define _glibtop_get_fsusage_read_write(S, B, P) ((void)0) static inline void
_glibtop_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path)
{
/* NOOP */
}
#endif #endif
/* end _glibtop_get_fsusage_read_write */ /* end _glibtop_get_fsusage_read_write */
@@ -165,8 +170,6 @@ glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf,
memset (buf, 0, sizeof (glibtop_fsusage)); memset (buf, 0, sizeof (glibtop_fsusage));
_glibtop_get_fsusage_read_write(server, buf, path);
#ifdef STAT_STATFS3_OSF1 #ifdef STAT_STATFS3_OSF1
if (statfs (path, &fsd, sizeof (struct statfs)) != 0) if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
@@ -245,30 +248,37 @@ glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf,
#endif /* STAT_STATFS4 */ #endif /* STAT_STATFS4 */
#ifdef STAT_STATVFS /* SVR4 */ #ifdef STAT_STATVFS /* SVR4 */
/* Linux, Solaris */
if (statvfs (path, &fsd) < 0) if (statvfs (path, &fsd) < 0)
return; return;
/* f_frsize isn't guaranteed to be supported. */ #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
buf->block_size = (fsd.f_frsize /* Solaris but not SunOS */
? PROPAGATE_ALL_ONES (fsd.f_frsize) buf->block_size = fsd.f_frsize;
: PROPAGATE_ALL_ONES (fsd.f_bsize)); #else
/* else, including Linux */
buf->block_size = fsd.f_bsize;
#endif
#endif /* STAT_STATVFS */ #endif /* STAT_STATVFS */
#if !defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS #if !defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS
/* !Ultrix && !SVR2 */ /* !Ultrix && !SVR2 */
/* Linux */
buf->blocks = PROPAGATE_ALL_ONES (fsd.f_blocks); buf->blocks = fsd.f_blocks;
buf->bfree = PROPAGATE_ALL_ONES (fsd.f_bfree); buf->bfree = fsd.f_bfree;
buf->bavail = PROPAGATE_TOP_BIT (fsd.f_bavail); buf->bavail = fsd.f_bavail;
/* buf->bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0; */ buf->files = fsd.f_files;
buf->files = PROPAGATE_ALL_ONES (fsd.f_files); buf->ffree = fsd.f_ffree;
buf->ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */ #endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
buf->flags = _glibtop_sysdeps_fsusage; buf->flags = _glibtop_sysdeps_fsusage;
/* setting additional flags is delegated */
_glibtop_get_fsusage_read_write(server, buf, path);
} }
#if defined _AIX && defined _I386 #if defined _AIX && defined _I386

View File

@@ -58,10 +58,7 @@ static int connect_to_internet_server (const char *serverhost, u_short port);
#include <arpa/inet.h> #include <arpa/inet.h>
int int
glibtop_make_connection (hostarg, portarg, s) glibtop_make_connection (const char *hostarg, int portarg, int *s)
const char *hostarg;
int portarg;
int *s;
{ {
#ifdef INTERNET_DOMAIN_SOCKETS #ifdef INTERNET_DOMAIN_SOCKETS
char *ptr; char *ptr;
@@ -201,8 +198,7 @@ connect_to_unix_server (void)
* internet address passed. Return -1 on error. * internet address passed. Return -1 on error.
*/ */
long long
glibtop_internet_addr (host) glibtop_internet_addr (const char *host)
const char *host;
{ {
struct hostent *hp; /* pointer to host info for remote host */ struct hostent *hp; /* pointer to host info for remote host */
IN_ADDR numeric_addr; /* host address */ IN_ADDR numeric_addr; /* host address */

View File

@@ -22,7 +22,6 @@
#include <glib.h> #include <glib.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include "mountlist.h"
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h> #include <string.h>
@@ -33,7 +32,18 @@
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/mountlist.h> #include <glibtop/mountlist.h>
static struct mount_entry *read_filesystem_list (gboolean need_fs_type); /* A mount table entry. */
struct mount_entry
{
char *me_devname; /* Device node pathname, including "/dev/". */
char *me_mountdir; /* Mount point directory pathname. */
char *me_type; /* "nfs", "4.2", etc. */
dev_t me_dev; /* Device number of me_mountdir. */
struct mount_entry *me_next;
};
static struct mount_entry *read_filesystem_list (void);
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>
@@ -207,12 +217,10 @@ fstype_to_string (int t)
/* Return a list of the currently mounted filesystems, or NULL on error. /* Return a list of the currently mounted filesystems, or NULL on error.
Add each entry to the tail of the list so that they stay in order. Add each entry to the tail of the list so that they stay in order.
If NEED_FS_TYPE is nonzero, ensure that the filesystem type fields in
the returned list are valid. Otherwise, they might not be.
*/ */
static struct mount_entry * static struct mount_entry *
read_filesystem_list (gboolean need_fs_type) read_filesystem_list (void)
{ {
struct mount_entry *mount_list; struct mount_entry *mount_list;
struct mount_entry *me; struct mount_entry *me;
@@ -396,9 +404,8 @@ read_filesystem_list (gboolean need_fs_type)
#endif #endif
me->me_mountdir = g_strdup (mnt.mt_filsys); me->me_mountdir = g_strdup (mnt.mt_filsys);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_type = g_strdup ("");
#ifdef GETFSTYP /* SVR3. */ #ifdef GETFSTYP /* SVR3. */
if (need_fs_type)
{ {
struct statfs fsd; struct statfs fsd;
char typebuf[FSTYPSZ]; char typebuf[FSTYPSZ];
@@ -407,7 +414,10 @@ read_filesystem_list (gboolean need_fs_type)
&& sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1) && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1)
me->me_type = g_strdup (typebuf); me->me_type = g_strdup (typebuf);
} }
#else
me->me_type = g_strdup ("");
#endif #endif
me->me_next = NULL; me->me_next = NULL;
/* Add to the linked list. */ /* Add to the linked list. */
@@ -530,11 +540,15 @@ static gboolean ignore_mount_entry(const struct mount_entry *me)
"procfs", "procfs",
"autofs", "autofs",
"sysfs", "sysfs",
"usbfs",
"none", "none",
"devpts", "devpts",
"usbdevfs", "usbdevfs",
"binfmt_misc", "binfmt_misc",
"supermount" "supermount",
"mntfs",
"openpromfs",
"unknown"
}; };
const char (*i)[12] = &ignored[0]; const char (*i)[12] = &ignored[0];
@@ -563,7 +577,7 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs)
/* Read filesystem list. */ /* Read filesystem list. */
if((entries = read_filesystem_list (TRUE)) == NULL) if((entries = read_filesystem_list ()) == NULL)
return NULL; return NULL;
for (cur = &entries[0]; cur != NULL; cur = next) { for (cur = &entries[0]; cur != NULL; cur = next) {
@@ -592,5 +606,9 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs)
buf->number = mount_array->len; buf->number = mount_array->len;
buf->total = buf->number * buf->size; buf->total = buf->number * buf->size;
buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE)
| (1 << GLIBTOP_MOUNTLIST_SIZE)
| (1 << GLIBTOP_MOUNTLIST_TOTAL);
return (glibtop_mountentry*) g_array_free(mount_array, FALSE); return (glibtop_mountentry*) g_array_free(mount_array, FALSE);
} }

View File

@@ -1,27 +0,0 @@
/* mountlist.h -- declarations for list of mounted filesystems
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
This program 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, 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. */
/* A mount table entry. */
struct mount_entry
{
char *me_devname; /* Device node pathname, including "/dev/". */
char *me_mountdir; /* Mount point directory pathname. */
char *me_type; /* "nfs", "4.2", etc. */
dev_t me_dev; /* Device number of me_mountdir. */
struct mount_entry *me_next;
};

View File

@@ -1,3 +1,53 @@
2004-11-29 Benoît Dejean <tazforever@dlfp.org>
* proclist.c: (glibtop_get_proclist_s): Fixed procstate test.
2004-11-15 Benoît Dejean <tazforever@dlfp.org>
* netload.c: (get_ipv6), (glibtop_get_netload_s): Added a check for NULL
pointer when wlaking though interfaces (though i don't understand why some
interface don't have an ifa_addr).
Move all ipv6 code into a separate function. Added a paranoid check on
getifaddrs.
2004-10-26 Benoît Dejean <tazforever@dlfp.org>
* proctime.c: (glibtop_get_proc_time_s): Set .rtime. At last !
2004-09-24 Benoît Dejean <tazforever@dlfp.org>
* loadavg.c: (glibtop_get_loadavg_s):
* msg_limits.c: (glibtop_get_msg_limits_s):
* shm_limits.c: (glibtop_get_shm_limits_s): Small cleanup.
2004-09-23 Benoît Dejean <tazforever@dlfp.org>
* glibtop_server.c:
* glibtop_server.h:
* procmem.c: (glibtop_get_proc_mem_s):
* procsegment.c: (glibtop_get_proc_segment_s): Removed get_pageshift().
Every one can affort a * instead of a >>, no need for this kind of
non-reentrant optimization. Saved 144B (obviously perfect cleanup ;)
2004-09-22 Benoît Dejean <tazforever@dlfp.org>
* glibtop_server.c: Removed #warning, my gcc is not buggy anymore.
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (linux_2_6_0), (linux_2_4_0),
(_glibtop_linux_get_fsusage_read_write): Back to previous version.
Now set .flags correctly.
2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (linux_2_6_0), (linux_2_4_0),
(_glibtop_linux_get_fsusage_read_write): Updated to match new prototype.
2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* mem.c: (glibtop_get_mem_s): Added missing memset( , 0, ).
2004-08-03 Benoît Dejean <tazforever@dlfp.org> 2004-08-03 Benoît Dejean <tazforever@dlfp.org>
* glibtop_server.h: Added next_token(). Changed skip_token(), * glibtop_server.h: Added next_token(). Changed skip_token(),

View File

@@ -28,9 +28,7 @@ static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
while((emnt = getmntent(mtab)) != NULL) while((emnt = getmntent(mtab)) != NULL)
{ {
if(strcmp(emnt->mnt_dir, path) != 0) if(strcmp(emnt->mnt_dir, path) == 0)
continue;
else
{ {
char filename[64]; /* magic */ char filename[64]; /* magic */
@@ -76,6 +74,10 @@ static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
buf->read = strtoull(p, &p, 0); buf->read = strtoull(p, &p, 0);
p = skip_token(p); p = skip_token(p);
buf->write = strtoull(p, &p, 0); buf->write = strtoull(p, &p, 0);
buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
break;
} }
} }

View File

@@ -9,9 +9,6 @@
#include <fcntl.h> #include <fcntl.h>
/* gcc warning bug */
unsigned get_pageshift();
unsigned long long unsigned long long
get_scaled(const char *buffer, const char *key) get_scaled(const char *buffer, const char *key)
@@ -85,21 +82,3 @@ file_to_buffer(glibtop *server, char *buffer, const char *filename)
} }
#warning "Ignore the following warning"
unsigned get_pageshift()
{
static unsigned pageshift = 0;
if(G_UNLIKELY(!pageshift))
{
register unsigned pagesize = getpagesize();
while( pagesize > 1 )
{
pagesize >>= 1;
pageshift++;
}
}
return pageshift;
}

View File

@@ -39,8 +39,6 @@ G_BEGIN_DECLS
#define LINUX_VERSION_CODE(x,y,z) (0x10000*(x) + 0x100*(y) + z) #define LINUX_VERSION_CODE(x,y,z) (0x10000*(x) + 0x100*(y) + z)
unsigned get_pageshift();
static inline char* static inline char*
next_token(const char *p) next_token(const char *p)
{ {

View File

@@ -62,7 +62,7 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
buf->flags = _glibtop_sysdeps_loadavg; buf->flags = _glibtop_sysdeps_loadavg;
while (isspace(*p)) p++; p = next_token(p);
/* Older Linux versions don't have the nr_running/nr_tasks fields. */ /* Older Linux versions don't have the nr_running/nr_tasks fields. */

View File

@@ -50,6 +50,8 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0); glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
memset(buf, 0, sizeof *buf);
file_to_buffer(server, buffer, FILENAME); file_to_buffer(server, buffer, FILENAME);
buf->total = get_scaled(buffer, "MemTotal:"); buf->total = get_scaled(buffer, "MemTotal:");

View File

@@ -51,8 +51,6 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
memset (buf, 0, sizeof (glibtop_msg_limits)); memset (buf, 0, sizeof (glibtop_msg_limits));
buf->flags = _glibtop_sysdeps_msg_limits;
msgctl (0, IPC_INFO, (struct msqid_ds *) &msginfo); msgctl (0, IPC_INFO, (struct msqid_ds *) &msginfo);
buf->msgpool = msginfo.msgpool; buf->msgpool = msginfo.msgpool;
@@ -62,4 +60,5 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
buf->msgmni = msginfo.msgmni; buf->msgmni = msginfo.msgmni;
buf->msgssz = msginfo.msgssz; buf->msgssz = msginfo.msgssz;
buf->msgtql = msginfo.msgtql; buf->msgtql = msginfo.msgtql;
buf->flags = _glibtop_sysdeps_msg_limits;
} }

View File

@@ -25,6 +25,9 @@
#include <glibtop/error.h> #include <glibtop/error.h>
#include <glibtop/netload.h> #include <glibtop/netload.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -116,6 +119,69 @@ glibtop_init_netload_s (glibtop *server)
_glibtop_sysdeps_netload_packets; _glibtop_sysdeps_netload_packets;
} }
#ifdef HAVE_IFADDRS_H
static void get_ipv6(glibtop *server, glibtop_netload *buf,
const char *interface)
{
struct ifaddrs *ifa0, *ifr6;
if(getifaddrs (&ifa0) != 0)
{
glibtop_warn_r(server, "getifaddrs failed : %s", strerror(errno));
return;
}
for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) {
if (strcmp (ifr6->ifa_name, interface) == 0
&& ifr6->ifa_addr != NULL
&& ifr6->ifa_addr->sa_family == AF_INET6)
break;
}
if(!ifr6) goto free_ipv6;
memcpy(buf->address6,
&((struct sockaddr_in6 *) ifr6->ifa_addr)->sin6_addr,
16);
memcpy(buf->prefix6,
&((struct sockaddr_in6 *) ifr6->ifa_netmask)->sin6_addr,
16);
if (IN6_IS_ADDR_LINKLOCAL (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_LINK;
else if (IN6_IS_ADDR_SITELOCAL (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE;
else if (IN6_IS_ADDR_GLOBAL (buf->address6)
|| IN6_IS_ADDR_MC_ORGLOCAL (buf->address6)
|| IN6_IS_ADDR_V4COMPAT (buf->address6)
|| IN6_IS_ADDR_MULTICAST (buf->address6)
|| IN6_IS_ADDR_UNSPECIFIED (buf->address6)
)
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_GLOBAL;
else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST;
else
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN;
buf->flags |= _glibtop_sysdeps_netload_6;
free_ipv6:
freeifaddrs(ifa0);
}
#endif /* HAVE_IFADDRS_H */
/* Provides network statistics. */ /* Provides network statistics. */
void void
@@ -376,54 +442,10 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
fclose (f); fclose (f);
#ifdef HAVE_IFADDRS_H #ifdef HAVE_IFADDRS_H
/* IPv6 */ get_ipv6(server, buf, interface);
{
struct ifaddrs *ifa0, *ifr6;
getifaddrs (&ifa0);
for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) {
if (strcmp (ifr6->ifa_name, interface) == 0
&& ifr6->ifa_addr->sa_family == AF_INET6)
break;
}
if(!ifr6) goto free_ipv6;
memcpy(buf->address6,
&((struct sockaddr_in6 *) ifr6->ifa_addr)->sin6_addr,
16);
memcpy(buf->prefix6,
&((struct sockaddr_in6 *) ifr6->ifa_netmask)->sin6_addr,
16);
if (IN6_IS_ADDR_LINKLOCAL (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_LINK;
else if (IN6_IS_ADDR_SITELOCAL (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE;
else if (IN6_IS_ADDR_GLOBAL (buf->address6)
|| IN6_IS_ADDR_MC_ORGLOCAL (buf->address6)
|| IN6_IS_ADDR_V4COMPAT (buf->address6)
|| IN6_IS_ADDR_MULTICAST (buf->address6)
|| IN6_IS_ADDR_UNSPECIFIED (buf->address6)
)
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_GLOBAL;
else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST;
else
buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN;
buf->flags |= _glibtop_sysdeps_netload_6;
free_ipv6:
freeifaddrs(ifa0);
} /* IPV6 */
#endif /* HAVE_IFADDRS_H */ #endif /* HAVE_IFADDRS_H */
} }

View File

@@ -81,7 +81,7 @@ glibtop_open_s (glibtop *server, const char *program_name,
break; break;
} }
#if DEBUG #ifdef DEBUG
printf ("\nThis machine has %d CPUs.\n\n", server->ncpu); printf ("\nThis machine has %d CPUs.\n\n", server->ncpu);
#endif #endif
} }

View File

@@ -82,7 +82,7 @@ get_ISDN_stats (glibtop *server, int *in, int *out)
static gboolean is_ISDN_on (glibtop *server, int *online) static gboolean is_ISDN_on (glibtop *server, int *online)
{ {
FILE *f = 0; FILE *f = NULL;
char buffer [BUFSIZ], *p; char buffer [BUFSIZ], *p;
int i; int i;

View File

@@ -157,7 +157,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
if (which & GLIBTOP_EXCLUDE_IDLE) { if (which & GLIBTOP_EXCLUDE_IDLE) {
glibtop_get_proc_state_s (server, &procstate, pid); glibtop_get_proc_state_s (server, &procstate, pid);
if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE)) if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE))
if (procstate.state != 'R') continue; if (procstate.state != GLIBTOP_PROCESS_RUNNING) continue;
} }
if (which & GLIBTOP_EXCLUDE_SYSTEM) { if (which & GLIBTOP_EXCLUDE_SYSTEM) {

View File

@@ -49,7 +49,7 @@ void
glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
{ {
char buffer [BUFSIZ], *p; char buffer [BUFSIZ], *p;
const unsigned pageshift = get_pageshift(); const size_t pagesize = getpagesize();
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0); glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
@@ -76,10 +76,10 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
buf->resident = strtoull (p, &p, 0); buf->resident = strtoull (p, &p, 0);
buf->share = strtoull (p, &p, 0); buf->share = strtoull (p, &p, 0);
buf->size <<= pageshift; buf->size *= pagesize;
buf->resident <<= pageshift; buf->resident *= pagesize;
buf->share <<= pageshift; buf->share *= pagesize;
buf->rss <<= pageshift; buf->rss *= pagesize;
buf->flags |= _glibtop_sysdeps_proc_mem_statm; buf->flags |= _glibtop_sysdeps_proc_mem_statm;
} }

View File

@@ -53,7 +53,7 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
pid_t pid) pid_t pid)
{ {
char buffer [BUFSIZ], *p; char buffer [BUFSIZ], *p;
const unsigned pageshift = get_pageshift(); const size_t pagesize = getpagesize();
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
@@ -86,10 +86,10 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
buf->data_rss = strtoull (p, &p, 0); buf->data_rss = strtoull (p, &p, 0);
buf->dirty_size = strtoull (p, &p, 0); buf->dirty_size = strtoull (p, &p, 0);
buf->text_rss <<= pageshift; buf->text_rss *= pagesize;
buf->shlib_rss <<= pageshift; buf->shlib_rss *= pagesize;
buf->data_rss <<= pageshift; buf->data_rss *= pagesize;
buf->dirty_size <<= pageshift; buf->dirty_size *= pagesize;
buf->flags |= _glibtop_sysdeps_proc_segment_statm; buf->flags |= _glibtop_sysdeps_proc_segment_statm;
} }

View File

@@ -28,6 +28,7 @@
static const unsigned long _glibtop_sysdeps_proc_time = static const unsigned long _glibtop_sysdeps_proc_time =
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) +
(1L << GLIBTOP_PROC_TIME_RTIME) +
(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) + (1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
(1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) + (1L << GLIBTOP_PROC_TIME_FREQUENCY) + (1L << GLIBTOP_PROC_TIME_TIMEOUT) +
(1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME); (1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) + (1L << GLIBTOP_PROC_TIME_START_TIME);
@@ -69,6 +70,8 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
/* clock_t (1/100 s) */ /* clock_t (1/100 s) */
buf->utime = strtoull (p, &p, 0); buf->utime = strtoull (p, &p, 0);
buf->stime = strtoull (p, &p, 0); buf->stime = strtoull (p, &p, 0);
buf->rtime = buf->utime + buf->stime;
buf->cutime = strtoull (p, &p, 0); buf->cutime = strtoull (p, &p, 0);
buf->cstime = strtoull (p, &p, 0); buf->cstime = strtoull (p, &p, 0);
@@ -117,12 +120,11 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
if (!server->ncpu) if (!server->ncpu)
return; return;
/* FIXME: doesn't work with 2.6 */
if (proc_file_to_buffer (buffer, "/proc/%d/cpu", pid)) if (proc_file_to_buffer (buffer, "/proc/%d/cpu", pid))
return; return;
p = skip_token (buffer); p = skip_multiple_token (p, 3);
buf->utime = strtoull (p, &p, 0);
buf->stime = strtoull (p, &p, 0);
for (i = 0; i < GLIBTOP_NCPU; i++) { for (i = 0; i < GLIBTOP_NCPU; i++) {
if (strncmp (p+1, "cpu", 3) || !isdigit (p [4])) if (strncmp (p+1, "cpu", 3) || !isdigit (p [4]))

View File

@@ -50,8 +50,6 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
memset (buf, 0, sizeof (glibtop_shm_limits)); memset (buf, 0, sizeof (glibtop_shm_limits));
buf->flags = _glibtop_sysdeps_shm_limits;
shmctl (0, IPC_INFO, (struct shmid_ds *) &shminfo); shmctl (0, IPC_INFO, (struct shmid_ds *) &shminfo);
buf->shmmax = shminfo.shmmax; buf->shmmax = shminfo.shmmax;
@@ -59,4 +57,5 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
buf->shmmni = shminfo.shmmni; buf->shmmni = shminfo.shmmni;
buf->shmseg = shminfo.shmseg; buf->shmseg = shminfo.shmseg;
buf->shmall = shminfo.shmall; buf->shmall = shminfo.shmall;
buf->flags = _glibtop_sysdeps_shm_limits;
} }

View File

@@ -1,3 +1,24 @@
2004-10-11 Benoît Dejean <tazforever@dlfp.org>
* cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s):
* loadavg.c: (glibtop_get_loadavg_s):
* mem.c: (glibtop_init_mem_s), (glibtop_get_mem_s):
* open.c: (glibtop_get_kstats), (glibtop_open_s):
* procargs.c: (glibtop_get_proc_args_s):
* procdata.c: (glibtop_get_proc_data_psinfo_s),
(glibtop_get_proc_data_usage_s), (glibtop_get_proc_credentials_s),
(glibtop_get_proc_status_s):
* proclist.c: (glibtop_get_proclist_s):
* procmap.c: (glibtop_get_proc_map_s):
* procmem.c: (glibtop_get_proc_mem_s):
* procstate.c: (glibtop_get_proc_state_s):
* safeio.c:
* safeio.h:
* shm_limits.c: (glibtop_init_shm_limits_p),
(glibtop_get_shm_limits_p):
* swap.c: (glibtop_get_swap_s):
* uptime.c: (glibtop_get_uptime_s): Updated. Lots of cleanup.
2004-06-06 Benoît Dejean <tazforever@dlfp.org> 2004-06-06 Benoît Dejean <tazforever@dlfp.org>
* proclist.c: (glibtop_get_proclist_s): Removed useless tests. * proclist.c: (glibtop_get_proclist_s): Removed useless tests.

View File

@@ -30,14 +30,15 @@
#include <glibtop_private.h> #include <glibtop_private.h>
static const unsigned long _glibtop_sysdeps_cpu = static const unsigned long _glibtop_sysdeps_cpu_freq =
(1L << GLIBTOP_CPU_FREQUENCY);
static const unsigned long _glibtop_sysdeps_cpu_all =
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) + (1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
(1L << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_IDLE) +
(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) + (1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
(1L << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_IDLE) + (1L << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_IDLE) +
#if LIBGTOP_VERSION_CODE >= 1001002
(1L << GLIBTOP_XCPU_FLAGS) + (1L << GLIBTOP_XCPU_FLAGS) +
#endif
(1L << GLIBTOP_CPU_FREQUENCY); (1L << GLIBTOP_CPU_FREQUENCY);
/* Init function. */ /* Init function. */
@@ -45,7 +46,7 @@ static const unsigned long _glibtop_sysdeps_cpu =
void void
glibtop_init_cpu_s (glibtop *server) glibtop_init_cpu_s (glibtop *server)
{ {
server->sysdeps.cpu = _glibtop_sysdeps_cpu; server->sysdeps.cpu = _glibtop_sysdeps_cpu_all;
} }
/* Provides information about cpu usage. */ /* Provides information about cpu usage. */
@@ -53,43 +54,41 @@ glibtop_init_cpu_s (glibtop *server)
void void
glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
{ {
kstat_ctl_t *kc = server->machine.kc; kstat_ctl_t * const kc = server->machine.kc;
cpu_stat_t cpu_stat; cpu_stat_t cpu_stat;
processorid_t cpu; processorid_t cpu;
int ncpu, found; int ncpu, found;
kid_t ret;
memset (buf, 0, sizeof (glibtop_cpu)); memset (buf, 0, sizeof (glibtop_cpu));
buf->frequency = server->machine.ticks;
buf->flags = _glibtop_sysdeps_cpu_freq;
if(!kc) if(!kc)
return; return;
switch(kstat_chain_update(kc)) switch(kstat_chain_update(kc))
{ {
case -1: assert(0); /* Debugging purposes, shouldn't happen */ case -1: assert(0); /* Debugging purposes, shouldn't happen */
case 0: break; case 0: break;
default: glibtop_get_kstats(server); default: glibtop_get_kstats(server);
} }
ncpu = server->ncpu;
if (ncpu > GLIBTOP_NCPU) ncpu = MIN(GLIBTOP_NCPU, server->ncpu);
ncpu = GLIBTOP_NCPU;
for (cpu = 0, found = 0; cpu < GLIBTOP_NCPU && found != ncpu; cpu++) for (cpu = 0, found = 0; cpu < GLIBTOP_NCPU && found != ncpu; cpu++)
{ {
kstat_t *ksp = server->machine.cpu_stat_kstat [cpu]; kstat_t * const ksp = server->machine.cpu_stat_kstat [cpu];
if (!ksp) continue; if (!ksp) continue;;
++found; ++found;
if(p_online(cpu, P_STATUS) == P_ONLINE) if(p_online(cpu, P_STATUS) == P_ONLINE)
#if LIBGTOP_VERSION_CODE >= 1001002
buf->xcpu_flags |= (1L << cpu); buf->xcpu_flags |= (1L << cpu);
#else
;
#endif
else else
continue; continue;
ret = kstat_read (kc, ksp, &cpu_stat);
if (ret == -1) { if (kstat_read (kc, ksp, &cpu_stat) == -1) {
glibtop_warn_io_r (server, "kstat_read (cpu_stat%d)", cpu); glibtop_warn_io_r (server, "kstat_read (cpu_stat%d)", cpu);
continue; continue;
} }
@@ -97,7 +96,6 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
buf->xcpu_idle [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_IDLE]; buf->xcpu_idle [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_IDLE];
buf->xcpu_user [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_USER]; buf->xcpu_user [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_USER];
buf->xcpu_sys [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL]; buf->xcpu_sys [cpu] = cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL];
buf->xcpu_total [cpu] = buf->xcpu_idle [cpu] + buf->xcpu_user [cpu] + buf->xcpu_total [cpu] = buf->xcpu_idle [cpu] + buf->xcpu_user [cpu] +
buf->xcpu_sys [cpu]; buf->xcpu_sys [cpu];
@@ -106,8 +104,9 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
buf->sys += cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL]; buf->sys += cpu_stat.cpu_sysinfo.cpu [CPU_KERNEL];
} }
buf->total = buf->idle + buf->user + buf->sys; if(!found)
buf->frequency = server->machine.ticks; return;
buf->flags = _glibtop_sysdeps_cpu; buf->total = buf->idle + buf->user + buf->sys;
buf->flags = _glibtop_sysdeps_cpu_all;
} }

View File

@@ -51,29 +51,34 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
#ifndef HAVE_GETLOADAVG #ifndef HAVE_GETLOADAVG
kstat_ctl_t *kc; kstat_ctl_t *kc;
kstat_t *ksp; kstat_t *ksp;
int i; size_t i;
static const char *avestrings[] = { "avenrun_1min", static const char avestrings[][14] = { "avenrun_1min",
"avenrun_5min", "avenrun_5min",
"avenrun_15min" }; "avenrun_15min" };
#endif #endif
memset (buf, 0, sizeof (glibtop_loadavg)); memset (buf, 0, sizeof (glibtop_loadavg));
#ifdef HAVE_GETLOADAVG #ifdef HAVE_GETLOADAVG
if (getloadavg (buf->loadavg, 3)) if (getloadavg (buf->loadavg, 3) != 3)
return; return;
#else #else
if(!(kc = server->machine.kc)) if(!(kc = server->machine.kc))
return; return;
switch(kstat_chain_update(kc)) switch(kstat_chain_update(kc))
{ {
case -1: assert(0); /* Debugging, shouldn't happen */ case -1: assert(0); /* Debugging, shouldn't happen */
case 0: break; case 0: break;
default: glibtop_get_kstats(server); default: glibtop_get_kstats(server);
} }
if(!(ksp = server->machine.system)) if(!(ksp = server->machine.system))
return; return;
if(kstat_read(kc, ksp, NULL) < 0) if(kstat_read(kc, ksp, NULL) < 0)
return; return;
for(i = 0; i < 3; ++i) /* Do we have a countof macro? */ for(i = 0; i < 3; ++i) /* Do we have a countof macro? */
{ {
kstat_named_t *kn; kstat_named_t *kn;
@@ -82,6 +87,7 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
if(kn) if(kn)
buf->loadavg[i] = (double)kn->value.ul / FSCALE; buf->loadavg[i] = (double)kn->value.ul / FSCALE;
} }
#endif #endif /* HAVE_GETLOADAVG */
buf->flags = _glibtop_sysdeps_loadavg; buf->flags = _glibtop_sysdeps_loadavg;
} }

View File

@@ -29,22 +29,18 @@
#include <glibtop_private.h> #include <glibtop_private.h>
static const unsigned long _glibtop_sysdeps_mem_os_sysconf =
(1L << GLIBTOP_MEM_TOTAL);
static const unsigned long _glibtop_sysdeps_mem_os_kstat =
(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_USED) +
(1L << GLIBTOP_MEM_LOCKED);
static const unsigned long _glibtop_sysdeps_mem_bunyip =
(1L << GLIBTOP_MEM_SHARED) + (1L << GLIBTOP_MEM_BUFFER) +
(1L << GLIBTOP_MEM_USER);
/* Init function. */ /* Init function. */
void void
glibtop_init_mem_s (glibtop *server) glibtop_init_mem_s (glibtop *server)
{ {
server->sysdeps.mem = _glibtop_sysdeps_mem_os_sysconf + server->sysdeps.mem = (1L << GLIBTOP_MEM_TOTAL)
_glibtop_sysdeps_mem_os_kstat + _glibtop_sysdeps_mem_bunyip; | (1L << GLIBTOP_MEM_FREE)
| (1L << GLIBTOP_MEM_USED)
| (1L << GLIBTOP_MEM_LOCKED)
| (1L << GLIBTOP_MEM_SHARED)
| (1L << GLIBTOP_MEM_BUFFER)
| (1L << GLIBTOP_MEM_USER);
} }
/* Provides information about memory usage. */ /* Provides information about memory usage. */
@@ -52,22 +48,30 @@ glibtop_init_mem_s (glibtop *server)
void void
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{ {
kstat_ctl_t *kc = server->machine.kc; kstat_ctl_t * const kc = server->machine.kc;
kstat_t *ksp; kstat_t *ksp;
kstat_named_t *kn; kstat_named_t *kn;
int pagesize = server->machine.pagesize;
#ifndef KSTAT_DATA_UINT32 #undef PAGESIZE
#define ui32 ul #define PAGESIZE (server->machine.pagesize)
#define PAGESHIFT (PAGESIZE + 10)
#ifdef _LP64
#define KN_VALUE kn->value.ui64
#elif !defined(KSTAT_DATA_UINT32)
#define KN_VALUE kn->value.ul
#else
#define KN_VALUE kn->value.ui32
#endif #endif
memset (buf, 0, sizeof (glibtop_mem)); memset (buf, 0, sizeof (glibtop_mem));
buf->total = (guint64)sysconf(_SC_PHYS_PAGES) << pagesize << 10; buf->total = (guint64) sysconf(_SC_PHYS_PAGES) << PAGESHIFT;
buf->flags = _glibtop_sysdeps_mem_os_sysconf; buf->flags = (1 << GLIBTOP_MEM_TOTAL);
if(!kc) if(!kc)
return; return;
switch(kstat_chain_update(kc)) switch(kstat_chain_update(kc))
{ {
case -1: assert(0); /* Debugging purposes, shouldn't happen */ case -1: assert(0); /* Debugging purposes, shouldn't happen */
@@ -77,51 +81,54 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
if((ksp = server->machine.syspages) && kstat_read(kc, ksp, NULL) >= 0) if((ksp = server->machine.syspages) && kstat_read(kc, ksp, NULL) >= 0)
{ {
kn = (kstat_named_t *)kstat_data_lookup(ksp, "pagesfree"); kn = kstat_data_lookup(ksp, "pagesfree");
if(kn) if(kn)
{ {
#ifdef _LP64 buf->free = (KN_VALUE << PAGESHIFT);
buf->free = kn->value.ui64 << pagesize << 10;
#else
buf->free = kn->value.ui32 << pagesize << 10;
#endif
buf->used = buf->total - buf->free; buf->used = buf->total - buf->free;
buf->flags |= (1 << GLIBTOP_MEM_FREE);
buf->flags |= (1 << GLIBTOP_MEM_USED);
} }
kn = (kstat_named_t *)kstat_data_lookup(ksp, "pageslocked");
kn = kstat_data_lookup(ksp, "pageslocked");
if(kn) if(kn)
#ifdef _LP64 {
buf->locked = kn->value.ui64 << pagesize; buf->locked = (KN_VALUE << PAGESIZE);
#else buf->flags |= (1 << GLIBTOP_MEM_LOCKED);
buf->locked = kn->value.ui32 << pagesize; }
#endif
buf->flags += _glibtop_sysdeps_mem_os_kstat;
} }
/* Bunyip module provides data in multiples of system page size */ /* Bunyip module provides data in multiples of system page size */
if((ksp = server->machine.bunyip) && kstat_read(kc, ksp, NULL) >= 0) if((ksp = server->machine.bunyip) && kstat_read(kc, ksp, NULL) >= 0)
{ {
kn = (kstat_named_t *)kstat_data_lookup(ksp, "pages_anon"); kn = kstat_data_lookup(ksp, "pages_exec");
if(kn) if(kn)
#ifdef _LP64 {
buf->user = kn->value.ui64 << pagesize << 10; buf->shared = (KN_VALUE << PAGESHIFT);
#else buf->flags |= (1 << GLIBTOP_MEM_SHARED);
buf->user = kn->value.ui32 << pagesize << 10; }
#endif
kn = (kstat_named_t *)kstat_data_lookup(ksp, "pages_exec"); kn = kstat_data_lookup(ksp, "pages_vnode");
if(kn) if(kn)
#ifdef _LP64 {
buf->shared = kn->value.ui64 << pagesize << 10; buf->buffer = (KN_VALUE << PAGESHIFT);
#else buf->flags |= (1 << GLIBTOP_MEM_BUFFER);
buf->shared = kn->value.ui32 << pagesize << 10; }
#endif
kn = (kstat_named_t *)kstat_data_lookup(ksp, "pages_vnode"); kn = kstat_data_lookup(ksp, "pages_anon");
if(kn) if(kn)
#ifdef _LP64 {
buf->buffer = kn->value.ui64 << pagesize << 10; buf->user = (KN_VALUE << PAGESHIFT);
#else buf->flags |= (1 << GLIBTOP_MEM_USER);
buf->buffer = kn->value.ui32 << pagesize << 10; }
#endif else
buf->flags += _glibtop_sysdeps_mem_bunyip; goto user_old_way;
}
else /* Bunyip is not available, let's compute buf->user the old way */
{
user_old_way:
buf->user = buf->total - buf->free - buf->cached - buf->buffer;
buf->flags |= (1 << GLIBTOP_MEM_USER);
} }
} }

View File

@@ -44,7 +44,8 @@ glibtop_get_kstats(glibtop *server)
kstat_t *ksp; kstat_t *ksp;
int nproc_same, new_ncpu; int nproc_same, new_ncpu;
new_ncpu = sysconf(_SC_NPROCESSORS_CONF); server->ncpu = new_ncpu = sysconf(_SC_NPROCESSORS_CONF);
if(!kc) if(!kc)
{ {
@@ -57,6 +58,7 @@ glibtop_get_kstats(glibtop *server)
} }
do { do {
ksp = kstat_lookup(kc, "unix", -1, "vminfo"); ksp = kstat_lookup(kc, "unix", -1, "vminfo");
server->machine.vminfo_kstat = ksp; server->machine.vminfo_kstat = ksp;
if(ksp) if(ksp)
@@ -91,15 +93,15 @@ glibtop_get_kstats(glibtop *server)
++checked; ++checked;
} }
} }
if(!nproc_same) if(!nproc_same)
{ {
processorid_t p; processorid_t p;
int found; int found;
char cpu[20]; char cpu[20];
if(new_ncpu > GLIBTOP_NCPU) server->ncpu = new_ncpu = MIN(new_ncpu, GLIBTOP_NCPU);
new_ncpu = GLIBTOP_NCPU;
server->ncpu = new_ncpu;
for(p = 0, found = 0; p < GLIBTOP_NCPU && found != new_ncpu; ++p) for(p = 0, found = 0; p < GLIBTOP_NCPU && found != new_ncpu; ++p)
{ {
if(p_online(p, P_STATUS) < 0) if(p_online(p, P_STATUS) < 0)

View File

@@ -25,6 +25,8 @@
#include <glibtop/error.h> #include <glibtop/error.h>
#include <glibtop/procargs.h> #include <glibtop/procargs.h>
#include "glibtop_private.h"
static const unsigned long _glibtop_sysdeps_proc_args = static const unsigned long _glibtop_sysdeps_proc_args =
(1L << GLIBTOP_PROC_ARGS_SIZE); (1L << GLIBTOP_PROC_ARGS_SIZE);
@@ -47,7 +49,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
#else #else
struct prpsinfo pinfo; struct prpsinfo pinfo;
#endif #endif
int len, i; unsigned len;
char *ret, *p; char *ret, *p;
memset (buf, 0, sizeof (glibtop_proc_args)); memset (buf, 0, sizeof (glibtop_proc_args));
@@ -55,28 +57,28 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
if(glibtop_get_proc_data_psinfo_s(server, &pinfo, pid)) if(glibtop_get_proc_data_psinfo_s(server, &pinfo, pid))
return NULL; return NULL;
/* strnlen */
for(len = 0; len < PRARGSZ; ++len) for(len = 0; len < PRARGSZ; ++len)
if(!(pinfo.pr_psargs[len])) if(!(pinfo.pr_psargs[len]))
break; break;
if(max_len)
if(max_len && max_len < len)
{ {
ret = g_malloc(max_len + 1);
if(max_len < len)
len = max_len; len = max_len;
memcpy(ret, pinfo.pr_psargs, len);
ret[len] = 0;
} }
else
{
ret = g_malloc(len + 1); ret = g_malloc(len + 1);
memcpy(ret, pinfo.pr_psargs, len); memcpy(ret, pinfo.pr_psargs, len);
ret[len] = 0; ret[len] = 0;
for(p = ret; *p; ++p)
{
if(*p == ' ') *p = 0;
}
buf->size = len; buf->size = len;
buf->flags = _glibtop_sysdeps_proc_args; buf->flags = _glibtop_sysdeps_proc_args;
}
for(p = ret; *p; ++p)
if(*p == ' ')
*p = 0;
return ret; return ret;
} }

View File

@@ -53,14 +53,16 @@ glibtop_get_proc_data_psinfo_s (glibtop *server, struct psinfo *psinfo, pid_t pi
char buffer [BUFSIZ]; char buffer [BUFSIZ];
sprintf (buffer, "/proc/%d/psinfo", (int) pid); sprintf (buffer, "/proc/%d/psinfo", (int) pid);
fd = s_open (buffer, O_RDONLY); fd = s_open (buffer, O_RDONLY);
if (fd < 0) { if (fd < 0) {
glibtop_warn_io_r (server, "open (%s)", buffer); glibtop_warn_io_r (server, "open (%s)", buffer);
return -1; return -1;
} }
if (s_pread (fd, psinfo, sizeof (struct psinfo), 0) != if (s_pread (fd, psinfo, sizeof (struct psinfo), 0)
sizeof (struct psinfo)) != sizeof (struct psinfo))
{ {
s_close (fd); s_close (fd);
glibtop_warn_io_r (server, "pread (%s)", buffer); glibtop_warn_io_r (server, "pread (%s)", buffer);
@@ -78,14 +80,16 @@ glibtop_get_proc_data_usage_s (glibtop *server, struct prusage *prusage, pid_t p
char buffer [BUFSIZ]; char buffer [BUFSIZ];
sprintf (buffer, "/proc/%d/usage", (int) pid); sprintf (buffer, "/proc/%d/usage", (int) pid);
fd = s_open (buffer, O_RDONLY); fd = s_open (buffer, O_RDONLY);
if (fd < 0) { if (fd < 0) {
glibtop_warn_io_r (server, "open (%s)", buffer); glibtop_warn_io_r (server, "open (%s)", buffer);
return -1; return -1;
} }
if (s_pread (fd, prusage, sizeof (struct prusage), 0) != if (s_pread (fd, prusage, sizeof (struct prusage), 0)
sizeof (struct prusage)) != sizeof (struct prusage))
{ {
s_close (fd); s_close (fd);
glibtop_warn_io_r (server, "pread (%s)", buffer); glibtop_warn_io_r (server, "pread (%s)", buffer);
@@ -108,33 +112,35 @@ glibtop_get_proc_credentials_s(glibtop *server,
char buffer[BUFSIZ]; char buffer[BUFSIZ];
sprintf(buffer, "/proc/%d/cred", (int)pid); sprintf(buffer, "/proc/%d/cred", (int)pid);
if((fd = s_open(buffer, O_RDONLY)) < 0) if((fd = s_open(buffer, O_RDONLY)) < 0)
{ {
if(errno != EPERM && errno != EACCES) if(errno != EPERM && errno != EACCES)
glibtop_warn_io_r(server, "open (%s)", buffer); glibtop_warn_io_r(server, "open (%s)", buffer);
return -1; return -1;
} }
if(s_pread(fd, prcred, sizeof(struct prcred), 0) !=
sizeof(struct prcred)) if(s_pread(fd, prcred, sizeof(struct prcred), 0)
!= sizeof(struct prcred))
{ {
s_close(fd); s_close(fd);
glibtop_warn_io_r(server, "pread (%s)", buffer); glibtop_warn_io_r(server, "pread (%s)", buffer);
return -1; return -1;
} }
if(prcred->pr_ngroups >= 0) if(prcred->pr_ngroups >= 0)
{ {
if(prcred->pr_ngroups <= GLIBTOP_MAX_GROUPS) toread = MIN(prcred->pr_ngroups, GLIBTOP_MAX_GROUPS) * sizeof(gid_t);
toread = prcred->pr_ngroups * sizeof(gid_t);
else if((size_t) s_pread(fd,groups, toread,
toread = GLIBTOP_MAX_GROUPS * sizeof(gid_t); G_STRUCT_OFFSET(struct prcred, pr_groups))
if(s_pread(fd, groups, toread, != toread)
&(((struct prcred *)0)->pr_groups[0])) != toread)
prcred->pr_ngroups = 0; prcred->pr_ngroups = 0;
} }
s_close(fd); s_close(fd);
return 0; return 0;
} }
#endif #endif /* LIBGTOP_VERSION_CODE >= 1001002 */
int int
glibtop_get_proc_status_s(glibtop *server, struct pstatus *pstatus, pid_t pid) glibtop_get_proc_status_s(glibtop *server, struct pstatus *pstatus, pid_t pid)
@@ -149,8 +155,8 @@ glibtop_get_proc_status_s(glibtop *server, struct pstatus *pstatus, pid_t pid)
glibtop_warn_io_r(server, "open (%s)", buffer); glibtop_warn_io_r(server, "open (%s)", buffer);
return -1; return -1;
} }
if(s_pread(fd, pstatus, sizeof(struct pstatus), 0) != if(s_pread(fd, pstatus, sizeof(struct pstatus), 0)
sizeof(struct pstatus)) != sizeof(struct pstatus))
{ {
s_close(fd); s_close(fd);
glibtop_warn_io_r(server, "pread (%s)", buffer); glibtop_warn_io_r(server, "pread (%s)", buffer);

View File

@@ -24,6 +24,9 @@
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/proclist.h> #include <glibtop/proclist.h>
#include "safeio.h"
#include "glibtop_private.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <dirent.h> #include <dirent.h>
@@ -60,11 +63,11 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
DIR *proc; DIR *proc;
struct dirent *entry; struct dirent *entry;
char buffer [BUFSIZ]; char buffer [BUFSIZ];
unsigned count, total, pid, mask; unsigned count, total, pid = 0, mask;
unsigned pids [BLOCK_COUNT], *pids_chain = NULL; unsigned pids [BLOCK_COUNT], *pids_chain = NULL;
unsigned pids_size = 0, pids_offset = 0, new_size; unsigned pids_size = 0, pids_offset = 0, new_size;
struct stat statb; struct stat statb;
int len, i, ok; int len, ok;
memset (buf, 0, sizeof (glibtop_proclist)); memset (buf, 0, sizeof (glibtop_proclist));
mask = which & ~GLIBTOP_KERN_PROC_MASK; mask = which & ~GLIBTOP_KERN_PROC_MASK;
@@ -92,7 +95,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
} }
else else
{ {
sprintf(buffer, "/proc/%d", arg); sprintf(buffer, "/proc/%lld", arg);
if(s_stat(buffer, &statb) < 0) if(s_stat(buffer, &statb) < 0)
return NULL; return NULL;
} }
@@ -111,23 +114,13 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
ok = 1; len = strlen (entry->d_name); ok = 1; len = strlen (entry->d_name);
/* does it consist entirely of digits? */ /* does it consist entirely of digits? */
#if 0
/* It does, except for "." and "..". Let's speed up */ /* It does, except for "." and "..". Let's speed up */
for (i = 0; i < len; i++)
if (!isdigit (entry->d_name [i])) ok = 0;
if (!ok) continue;
#else
if(entry->d_name[0] == '.') if(entry->d_name[0] == '.')
continue; continue;
#endif
/* convert it in a number */ /* convert it in a number */
#if 0
if (sscanf (entry->d_name, "%u", &pid) != 1) continue;
#else
pid = (unsigned)atol(entry->d_name); pid = (unsigned)atol(entry->d_name);
#endif
#ifdef HAVE_PROCFS_H #ifdef HAVE_PROCFS_H

View File

@@ -27,7 +27,6 @@
#include <glibtop/procmap.h> #include <glibtop/procmap.h>
#include <errno.h> #include <errno.h>
#include <alloca.h>
#include "safeio.h" #include "safeio.h"
@@ -58,7 +57,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
int fd, i, nmaps, pr_err, heap; int fd, i, nmaps, pr_err, heap;
#if GLIBTOP_SOLARIS_RELEASE >= 560 #if GLIBTOP_SOLARIS_RELEASE >= 560
prxmap_t *maps; prxmap_t *maps;
struct ps_prochandle *Pr; struct ps_prochandle *Pr = NULL;
#else #else
prmap_t *maps; prmap_t *maps;
#endif #endif
@@ -97,7 +96,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
s_close(fd); s_close(fd);
return NULL; return NULL;
} }
maps = alloca(inode.st_size); maps = g_alloca(inode.st_size);
nmaps = inode.st_size / sizeof(prxmap_t); nmaps = inode.st_size / sizeof(prxmap_t);
if(s_pread(fd, maps, inode.st_size, 0) != inode.st_size) if(s_pread(fd, maps, inode.st_size, 0) != inode.st_size)
{ {
@@ -112,7 +111,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
s_close(fd); s_close(fd);
return NULL; return NULL;
} }
maps = alloca((nmaps + 1) * sizeof(prmap_t)); maps = g_alloca((nmaps + 1) * sizeof(prmap_t));
if(ioctl(fd, PIOCMAP, maps) < 0) if(ioctl(fd, PIOCMAP, maps) < 0)
{ {
glibtop_warn_io_r(server, "ioctl(%s, PIOCMAP)", buffer); glibtop_warn_io_r(server, "ioctl(%s, PIOCMAP)", buffer);

View File

@@ -24,6 +24,8 @@
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/procmem.h> #include <glibtop/procmem.h>
#include "glibtop_private.h"
static const unsigned long _glibtop_sysdeps_proc_mem = static const unsigned long _glibtop_sysdeps_proc_mem =
(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) +
(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS); (1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS);

View File

@@ -27,13 +27,11 @@
#include <glibtop_private.h> #include <glibtop_private.h>
static const unsigned long _glibtop_sysdeps_proc_state = static const unsigned long _glibtop_sysdeps_proc_state =
#if (LIBGTOP_VERSION_CODE >= 1001002) && defined(HAVE_PROCFS_H) #ifdef HAVE_PROCFS_H
(1L << GLIBTOP_PROC_STATE_HAS_CPU) + (1L << GLIBTOP_PROC_STATE_PROCESSOR) + (1L << GLIBTOP_PROC_STATE_HAS_CPU) + (1L << GLIBTOP_PROC_STATE_PROCESSOR) +
(1L << GLIBTOP_PROC_STATE_LAST_PROCESSOR) + (1L << GLIBTOP_PROC_STATE_LAST_PROCESSOR) +
#endif #endif
#if LIBGTOP_VERSION_CODE >= 1001002
(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID) + (1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID) +
#endif
(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) + (1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) +
(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID); (1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID);
@@ -63,10 +61,9 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
buf->uid = psinfo.pr_euid; buf->uid = psinfo.pr_euid;
buf->gid = psinfo.pr_egid; buf->gid = psinfo.pr_egid;
#if LIBGTOP_VERSION_CODE >= 1001002
buf->ruid = psinfo.pr_uid; buf->ruid = psinfo.pr_uid;
buf->rgid = psinfo.pr_gid; buf->rgid = psinfo.pr_gid;
#endif
#ifdef HAVE_PROCFS_H #ifdef HAVE_PROCFS_H
switch(psinfo.pr_lwp.pr_state) switch(psinfo.pr_lwp.pr_state)
#else #else
@@ -74,46 +71,29 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
#endif #endif
{ {
case SONPROC: case SONPROC:
#if (LIBGTOP_VERSION_CODE >= 1001002) && defined(HAVE_PROCFS_H) #ifdef HAVE_PROCFS_H
buf->has_cpu = 1; buf->has_cpu = 1;
buf->processor = psinfo.pr_lwp.pr_onpro; buf->processor = psinfo.pr_lwp.pr_onpro;
/* FIXME: fallthrough ? */
#endif #endif
case SRUN: case SRUN:
#if LIBGTOP_VERSION_CODE >= 1001002
buf->state = GLIBTOP_PROCESS_RUNNING; buf->state = GLIBTOP_PROCESS_RUNNING;
#else
buf->state = 'R';
#endif
break; break;
case SZOMB: case SZOMB:
#if LIBGTOP_VERSION_CODE >= 1001002
buf->state = GLIBTOP_PROCESS_ZOMBIE; buf->state = GLIBTOP_PROCESS_ZOMBIE;
#else
buf->state = 'Z';
#endif
break; break;
case SSLEEP: case SSLEEP:
#if LIBGTOP_VERSION_CODE >= 1001002
buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE;
#else
buf->state = 'S';
#endif
break; break;
case SSTOP: case SSTOP:
#if LIBGTOP_VERSION_CODE >= 1001002
buf->state = GLIBTOP_PROCESS_STOPPED; buf->state = GLIBTOP_PROCESS_STOPPED;
#else
buf->state = 'T';
#endif
break; break;
case SIDL: case SIDL:
#if LIBGTOP_VERSION_CODE >= 1001002
buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE; buf->state = GLIBTOP_PROCESS_UNINTERRUPTIBLE;
#else break;
buf->state = 'D';
#endif
} }
#if (LIBGTOP_VERSION_CODE >= 1001002) && defined(HAVE_PROCFS_H)
#ifdef HAVE_PROCFS_H
buf->last_processor = psinfo.pr_lwp.pr_onpro; buf->last_processor = psinfo.pr_lwp.pr_onpro;
#endif #endif
g_strlcpy (buf->cmd, psinfo.pr_fname, sizeof buf->cmd); g_strlcpy (buf->cmd, psinfo.pr_fname, sizeof buf->cmd);

View File

@@ -26,6 +26,8 @@
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include "safeio.h"
int int
s_open(const char *file, int mode) s_open(const char *file, int mode)
{ {

View File

@@ -22,6 +22,8 @@
#ifndef __GLIBTOP_SAFEIO_H__ #ifndef __GLIBTOP_SAFEIO_H__
#define __GLIBTOP_SAFEIO_H__ #define __GLIBTOP_SAFEIO_H__
#include <glib/gmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
@@ -45,4 +47,4 @@ s_closedir(DIR *);
G_END_DECLS G_END_DECLS
#endif #endif /* __GLIBTOP_SAFEIO_H__ */

View File

@@ -28,16 +28,23 @@
#include <sys/shm.h> #include <sys/shm.h>
static const struct nlist nlst[] = { {"shminfo"}, {NULL} }; static const struct nlist nlst[] = { {"shminfo"}, {NULL} };
#if GLIBTOP_SOLARIS_RELEASE < 590
static const unsigned long _glibtop_sysdeps_shm_limits =
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN);
#else
static const unsigned long _glibtop_sysdeps_shm_limits = static const unsigned long _glibtop_sysdeps_shm_limits =
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) + (1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG); (1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG);
#endif
/* Init function. */ /* Init function. */
void void
glibtop_init_shm_limits_p (glibtop *server) glibtop_init_shm_limits_p (glibtop *server)
{ {
kvm_t *kd = server->machine.kd; kvm_t * const kd = server->machine.kd;
if(kd && !kvm_nlist(kd, nlst)) if(kd && !kvm_nlist(kd, nlst))
server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits;
@@ -50,16 +57,18 @@ glibtop_init_shm_limits_p (glibtop *server)
void void
glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
{ {
kvm_t *kd = server->machine.kd; kvm_t * const kd = server->machine.kd;
struct shminfo sinfo; struct shminfo sinfo;
memset (buf, 0, sizeof (glibtop_shm_limits)); memset (buf, 0, sizeof (glibtop_shm_limits));
if(!(server->sysdeps.shm_limits)) if(!(server->sysdeps.shm_limits))
return; return;
if(kvm_read(kd, nlst[0].n_value, (void *)&sinfo, if(kvm_read(kd, nlst[0].n_value, (void *)&sinfo,
sizeof(struct shminfo)) != sizeof(struct shminfo)) sizeof(struct shminfo)) != sizeof(struct shminfo))
return; return;
buf->shmmax = sinfo.shmmax; buf->shmmax = sinfo.shmmax;
buf->shmmni = sinfo.shmmni; buf->shmmni = sinfo.shmmni;
#if GLIBTOP_SOLARIS_RELEASE < 590 #if GLIBTOP_SOLARIS_RELEASE < 590

View File

@@ -25,8 +25,8 @@
#include <glibtop/error.h> #include <glibtop/error.h>
#include <glibtop/swap.h> #include <glibtop/swap.h>
#include <assert.h> #include <unistd.h>
#include <sys/sysinfo.h> #include <sys/swap.h>
#include <glibtop_private.h> #include <glibtop_private.h>
@@ -47,43 +47,64 @@ glibtop_init_swap_s (glibtop *server)
void void
glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
{ {
kstat_ctl_t *kc = server->machine.kc; swaptbl_t *s = NULL;
kstat_t *ksp = server->machine.vminfo_kstat; int i, n1, n2;
guint64 swap_resv, swap_alloc, swap_avail, swap_free;
vminfo_t vminfo;
double rate;
kid_t ret;
memset (buf, 0, sizeof (glibtop_swap)); /* we don't care about ste_path, and we're lazy */
char shared_path[BUFSIZ]; /* hope this is large enough */
if (!ksp) return; const int pagesize = getpagesize();
switch(kstat_chain_update(kc)) memset(buf, 0, sizeof *buf);
switch( (n1 = swapctl(SC_GETNSWP, NULL)) )
{ {
case -1: assert(0); /* Debugging, shouldn't happen */ case -1:
case 0: break; glibtop_warn_r(server, "swapctl: GETNSWP");
default: glibtop_get_kstats(server);
}
ret = kstat_read (kc, ksp, &vminfo);
if (ret == -1) {
glibtop_warn_io_r (server, "kstat_read (vminfo)");
return; return;
case 0:
/* no swapfile */
goto out_no_swap;
default:
break;
} }
rate = (ksp->ks_snaptime - server->machine.vminfo_snaptime) / 1E+9; /* RTFM */
s = g_malloc(sizeof(swaptbl_t)
+ n1 * sizeof(swapent_t));
swap_resv = (vminfo.swap_resv - server->machine.vminfo.swap_resv) / rate; s->swt_n = n1;
swap_alloc = (vminfo.swap_alloc - server->machine.vminfo.swap_alloc) / rate;
swap_avail = (vminfo.swap_avail - server->machine.vminfo.swap_avail) / rate;
swap_free = (vminfo.swap_free - server->machine.vminfo.swap_free) / rate;
memcpy (&server->machine.vminfo, &vminfo, sizeof (vminfo_t)); /* initialize string pointers */
server->machine.vminfo_snaptime = ksp->ks_snaptime; for (i = 0; i < n1; i++)
{
s->swt_ent[i].ste_path = shared_path;
}
buf->total = swap_resv + swap_avail; if ((n2 = swapctl(SC_LIST, s)) < 0)
buf->used = swap_alloc; {
buf->free = buf->total - buf->used; glibtop_warn_r(server, "swapctl: SC_LIST");
goto out_free;
}
/* #swapfile may have changed between the 2 swapctl() calls
* we don't care, we just use the smallest #swapfile */
for (i = 0; i < MIN(n1, n2); i++)
{
buf->total += s->swt_ent[i].ste_pages;
buf->free += s->swt_ent[i].ste_free;
}
buf->total *= pagesize;
buf->free *= pagesize;
buf->used = buf->total - buf->free;
out_no_swap:
buf->flags = _glibtop_sysdeps_swap; buf->flags = _glibtop_sysdeps_swap;
out_free:
g_free(s);
} }

View File

@@ -27,10 +27,8 @@
#include <time.h> #include <time.h>
static const unsigned long _glibtop_sysdeps_uptime = static const unsigned long _glibtop_sysdeps_uptime =
#if LIBGTOP_VERSION_CODE >= 1001002 (1L <<GLIBTOP_UPTIME_BOOT_TIME)
(1L <<GLIBTOP_UPTIME_BOOT_TIME) + | (1L << GLIBTOP_UPTIME_UPTIME);
#endif
(1L << GLIBTOP_UPTIME_UPTIME);
/* Init function. */ /* Init function. */
@@ -49,9 +47,8 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
if(!(server->machine.boot)) if(!(server->machine.boot))
return; return;
#if LIBGTOP_VERSION_CODE >= 1001002
buf->boot_time = server->machine.boot; buf->boot_time = server->machine.boot;
#endif
buf->uptime = time(NULL) - server->machine.boot; buf->uptime = time(NULL) - server->machine.boot;
buf->flags = _glibtop_sysdeps_uptime; buf->flags = _glibtop_sysdeps_uptime;