summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-08-25 08:30:41 +0000
committerMartin Baulig <martin@src.gnome.org>1998-08-25 08:30:41 +0000
commite60200e8de04fba4df530c7ed7c9a5f5f564bd50 (patch)
tree6fef346c39cd185a4d05131a98e85ea84ebd4cf1
parentbcadc0319448a8081170f24511c4d98ca383105b (diff)
downloadlibgtop-e60200e8de04fba4df530c7ed7c9a5f5f564bd50.tar.gz
New file.
1998-08-25 Martin Baulig <martin@home-of-linux.org> * src/daemon/ChangeLog: New file. * sysdeps/sun4/ChangeLog: New file. * sysdeps/stub/ChangeLog: New file. * configure.in: Added check for `-lsocket'. (LIBGTOP_INCS): Added $(SUPPORTINCS). (INCLUDES): Added $(SUPPORTINCS). (LIBGTOP_EXTRA_LIBS): Added $(LIBSUPPORT). * acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME', `NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID' and `NEED_DECLARATION_GETPAGESIZE'. * includue/glibtop/global.h (<gnomesupport.h>): Include this. * lib/init.c (_init_server): Declared `static'. * lib/read_data.c: Added cast to `const void *' in calls to `recv' and `read' to avoid compiler warnings.
-rw-r--r--ChangeLog24
-rw-r--r--acconfig.h15
-rw-r--r--configure.in45
-rw-r--r--examples/ChangeLog4
-rw-r--r--examples/first.c94
-rw-r--r--examples/procmap.c4
-rw-r--r--examples/second.c31
-rw-r--r--include/glibtop/global.h4
-rw-r--r--lib/init.c2
-rw-r--r--lib/read_data.c6
10 files changed, 130 insertions, 99 deletions
diff --git a/ChangeLog b/ChangeLog
index a1422669..dc022a52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,26 @@
-1998-08-24 Martin Baulig <martin@home-of-linux.org>
+1998-08-25 Martin Baulig <martin@home-of-linux.org>
+
+ * src/daemon/ChangeLog: New file.
+
+ * sysdeps/sun4/ChangeLog: New file.
+
+ * sysdeps/stub/ChangeLog: New file.
+
+ * configure.in: Added check for `-lsocket'.
+ (LIBGTOP_INCS): Added $(SUPPORTINCS).
+ (INCLUDES): Added $(SUPPORTINCS).
+ (LIBGTOP_EXTRA_LIBS): Added $(LIBSUPPORT).
+
+ * acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME',
+ `NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID'
+ and `NEED_DECLARATION_GETPAGESIZE'.
+
+ * includue/glibtop/global.h (<gnomesupport.h>): Include this.
+
+ * lib/init.c (_init_server): Declared `static'.
+
+ * lib/read_data.c: Added cast to `const void *' in calls to
+ `recv' and `read' to avoid compiler warnings.
* configure.in (INCLUDES): No longer using installed header files.
diff --git a/acconfig.h b/acconfig.h
index e8ec4702..5e54b5af 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,3 +1,18 @@
+
+/* Define if gethostname () must be declared. */
+#undef NEED_DECLARATION_GETHOSTNAME
+
+/* Define if setreuid () must be declared. */
+#undef NEED_DECLARATION_SETREUID
+
+/* Define if setregid () must be declared. */
+#undef NEED_DECLARATION_SETREGID
+
+/* Define if getpagesize () must be declared. */
+#undef NEED_DECLARATION_GETPAGESIZE
+
+@TOP@
+
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
diff --git a/configure.in b/configure.in
index f20c936b..3ba85b62 100644
--- a/configure.in
+++ b/configure.in
@@ -59,6 +59,9 @@ GNOME_LIBGTOP_TYPES
GNOME_CHECK_GUILE
+dnl For Solaris
+AC_CHECK_LIB(socket, socket)
+
AC_ARG_WITH(libgtop-guile,
[ --with-libgtop-guile Build the libgtop guile interface (default=yes)],
[build_guile="$withval"], [build_guile=yes])
@@ -177,17 +180,20 @@ GNOME_FILEUTILS_CHECKS
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
-dnl If you want to use libgtop without gnome, uncomment the following paragraph:
-dnl LIBSUPPORT=
-dnl SUPPORTINCS=
-dnl if test "$need_gnome_support" = yes; then
-dnl LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
-dnl SUPPORTINCS='-I$(top_srcdir)/support'
-dnl fi
-dnl AC_SUBST(LIBSUPPORT)
-dnl AC_SUBST(SUPPORTINCS)
-
-dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS, we include it here.
+LIBSUPPORT=
+SUPPORTINCS=
+if test "$need_gnome_support" = yes; then
+ if test "x$gnome_found" = xyes ; then
+ LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
+ SUPPORTINCS="$GNOME_INCLUDEDIR"
+ else
+ LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
+ SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
+ fi
+fi
+
+dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS,
+dnl we include it here.
echo "$GNOME_LIBS" | grep -q -e '-lgnomesupport'
if test $? = 0 ; then
LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
@@ -204,6 +210,9 @@ if test x$build_inodedb = xyes ; then
LIBGTOP_INCS="$LIBGTOP_INCS -DGLIBTOP_INODEDB"
fi
+LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS"
+LIBGTOP_EXTRA_LIBS="$LIBGTOP_LIBS $LIBSUPPORT"
+
LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS"
LIBGTOP_BINDIR='$(bindir)'
@@ -256,7 +265,7 @@ else
guile_def=""
fi
-INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
+INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $SUPPORTINCS -W -Wall -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith $CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
AC_SUBST(INCLUDES)
@@ -273,18 +282,6 @@ AC_SUBST(LIBGTOP_GUILE_NAMES_INCS)
AC_SUBST(LIBGTOP_BINDIR)
AC_SUBST(LIBGTOP_SERVER)
-LIBSUPPORT=
-SUPPORTINCS=
-if test "$need_gnome_support" = yes; then
- if test "x$gnome_found" = xyes ; then
- LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
- SUPPORTINCS="$GNOME_INCLUDEDIR"
- else
- LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
- SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
- fi
-fi
-
if test x$libgtop_need_server = xyes ; then
sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid.la"
server_programs='libgtop_server'
diff --git a/examples/ChangeLog b/examples/ChangeLog
index 057a9465..c3e3e458 100644
--- a/examples/ChangeLog
+++ b/examples/ChangeLog
@@ -1,3 +1,7 @@
+1998-08-25 Martin Baulig <martin@home-of-linux.org>
+
+ * first.c, second.c, procmap.c: Fixed some compiler warnings.
+
1998-08-18 Martin Baulig <martin@home-of-linux.org>
* procmap.c: We now display filenames when compiled
diff --git a/examples/first.c b/examples/first.c
index d6eb11ce..0bc0a09e 100644
--- a/examples/first.c
+++ b/examples/first.c
@@ -44,8 +44,6 @@ main (int argc, char *argv [])
glibtop_sysdeps sysdeps;
unsigned c, method, count, port, i, *ptr;
char buffer [BUFSIZ];
- struct rlimit rlim;
- struct rusage ru;
pid_t pid, ppid;
count = PROFILE_COUNT;
@@ -223,16 +221,17 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, pid);
- printf ("Proc_State PID %5u (0x%08lx): '%s', %c, %u, %u\n", pid,
- (unsigned long) data.proc_state.flags,
+ printf ("Proc_State PID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
+ (int) pid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
- data.proc_state.uid, data.proc_state.gid);
+ (unsigned long) data.proc_state.uid,
+ (unsigned long) data.proc_state.gid);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, pid);
- printf ("Proc_Uid PID %5u (0x%08lx): "
- "%d %d %d %d %d %d %d %d %d %d %d %d\n", pid,
+ printf ("Proc_Uid PID %5d (0x%08lx): "
+ "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -244,15 +243,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, pid);
- getrlimit (RLIMIT_RSS, &rlim);
-
- fprintf (stderr, "GETRLIM: %lu - %lu - %lu\n",
- (unsigned long) rlim.rlim_cur,
- (unsigned long) rlim.rlim_max,
- (unsigned long) ((1 << 63) - 1));
-
- printf ("Proc_Mem PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Mem PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -264,8 +256,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, pid);
- printf ("Proc_Segment PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Segment PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -276,17 +268,11 @@ main (int argc, char *argv [])
(unsigned long) data.proc_segment.end_code,
(unsigned long) data.proc_segment.start_stack);
- getrusage (RUSAGE_SELF, &ru);
-
- fprintf (stderr, "GETRUSAGE: (%ld, %ld) - (%ld, %ld)\n",
- ru.ru_utime.tv_sec, ru.ru_utime.tv_usec,
- ru.ru_stime.tv_sec, ru.ru_stime.tv_usec);
-
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, pid);
- printf ("Proc_Time PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Time PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -301,8 +287,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, pid);
- printf ("Proc_Signal PID %5u (0x%08lx): "
- "%lu %lu %lu %lu\n", pid,
+ printf ("Proc_Signal PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
@@ -312,8 +298,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, pid);
- printf ("Proc_Kernel PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", pid,
+ printf ("Proc_Kernel PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -330,16 +316,17 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, ppid);
- printf ("Proc_State PPID %5u (0x%08lx): '%s', %c, %u, %u\n", ppid,
- (unsigned long) data.proc_state.flags,
+ printf ("Proc_State PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
+ (int) ppid, (unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
- data.proc_state.uid, data.proc_state.gid);
+ (unsigned long) data.proc_state.uid,
+ (unsigned long) data.proc_state.gid);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, ppid);
- printf ("Proc_Uid PPID %5u (0x%08lx): "
- "%d %d %d %d %d %d %d %d %d %d %d %d\n", ppid,
+ printf ("Proc_Uid PPID %5d (0x%08lx): "
+ "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -351,8 +338,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, ppid);
- printf ("Proc_Mem PPID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu\n", ppid,
+ printf ("Proc_Mem PPID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -364,8 +351,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, ppid);
- printf ("Proc_Segment PPID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
+ printf ("Proc_Segment PPID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -379,8 +366,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, ppid);
- printf ("Proc_Time PPID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
+ printf ("Proc_Time PPID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -395,8 +382,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, ppid);
- printf ("Proc_Signal PPID %5u (0x%08lx): %lu %lu %lu %lu\n", ppid,
- (unsigned long) data.proc_signal.flags,
+ printf ("Proc_Signal PPID %5d (0x%08lx): %lu %lu %lu %lu\n",
+ (int) ppid, (unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
(unsigned long) data.proc_signal.sigignore,
@@ -405,8 +392,8 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, ppid);
- printf ("Proc_Kernel PPID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", ppid,
+ printf ("Proc_Kernel PPID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) ppid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
@@ -423,15 +410,16 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_state (&data.proc_state, 1);
- printf ("Proc_State INIT %5u (0x%08lx): '%s', %c, %u, %u\n", 1,
+ printf ("Proc_State INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
- data.proc_state.uid, data.proc_state.gid);
+ (unsigned long) data.proc_state.uid,
+ (unsigned long) data.proc_state.gid);
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_uid (&data.proc_uid, 1);
- printf ("Proc_Uid INIT %5u (0x%08lx): "
+ printf ("Proc_Uid INIT %5d (0x%08lx): "
"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
@@ -444,7 +432,7 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_mem (&data.proc_mem, 1);
- printf ("Proc_Mem INIT %5u (0x%08lx): "
+ printf ("Proc_Mem INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
@@ -457,7 +445,7 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_segment (&data.proc_segment, 1);
- printf ("Proc_Segment INIT %5u (0x%08lx): "
+ printf ("Proc_Segment INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
@@ -472,7 +460,7 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_time (&data.proc_time, 1);
- printf ("Proc_Time INIT %5u (0x%08lx): "
+ printf ("Proc_Time INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
@@ -488,7 +476,7 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_signal (&data.proc_signal, 1);
- printf ("Proc_Signal INIT %5u (0x%08lx): "
+ printf ("Proc_Signal INIT %5d (0x%08lx): "
"%lu %lu %lu %lu\n", 1,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
@@ -499,7 +487,7 @@ main (int argc, char *argv [])
for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_kernel (&data.proc_kernel, 1);
- printf ("Proc_Kernel INIT %5u (0x%08lx): "
+ printf ("Proc_Kernel INIT %5d (0x%08lx): "
"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", 1,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
diff --git a/examples/procmap.c b/examples/procmap.c
index 9da8cf40..f6bc2e81 100644
--- a/examples/procmap.c
+++ b/examples/procmap.c
@@ -79,14 +79,14 @@ main (int argc, char *argv [])
glibtop_init_r (&glibtop_global_server, 0, 0);
- if ((argc != 2) || (sscanf (argv [1], "%d", &pid) != 1))
+ if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1))
glibtop_error ("Usage: %s pid", argv [0]);
#ifdef GLIBTOP_INODEDB
inodedb = glibtop_inodedb_open (0, 0);
#endif
- fprintf (stderr, "Getting memory maps for pid %d.\n\n", pid);
+ fprintf (stderr, "Getting memory maps for pid %d.\n\n", (int) pid);
maps = glibtop_get_proc_map (&procmap, pid);
diff --git a/examples/second.c b/examples/second.c
index 3dce440b..0ea53062 100644
--- a/examples/second.c
+++ b/examples/second.c
@@ -38,16 +38,17 @@ output (pid_t pid)
glibtop_get_proc_state (&data.proc_state, pid);
- printf ("Proc_State PID %5u (0x%08lx): "
- "'%s', %c, %u, %u\n", pid,
+ printf ("Proc_State PID %5d (0x%08lx): "
+ "'%s', %c, %lu, %lu\n", (int) pid,
(unsigned long) data.proc_state.flags,
data.proc_state.cmd, data.proc_state.state,
- data.proc_state.uid, data.proc_state.gid);
+ (unsigned long) data.proc_state.uid,
+ (unsigned long) data.proc_state.gid);
glibtop_get_proc_uid (&data.proc_uid, pid);
- printf ("Proc_Uid PID %5u (0x%08lx): "
- "%d %d %d %d %d %d %d %d %d %d %d %d\n", pid,
+ printf ("Proc_Uid PID %5d (0x%08lx): "
+ "%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
(unsigned long) data.proc_uid.flags,
data.proc_uid.uid, data.proc_uid.euid,
data.proc_uid.gid, data.proc_uid.egid,
@@ -58,8 +59,8 @@ output (pid_t pid)
glibtop_get_proc_mem (&data.proc_mem, pid);
- printf ("Proc_Mem PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Mem PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_mem.flags,
(unsigned long) data.proc_mem.size,
(unsigned long) data.proc_mem.vsize,
@@ -70,8 +71,8 @@ output (pid_t pid)
glibtop_get_proc_segment (&data.proc_segment, pid);
- printf ("Proc_Segment PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Segment PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_segment.flags,
(unsigned long) data.proc_segment.text_rss,
(unsigned long) data.proc_segment.shlib_rss,
@@ -84,8 +85,8 @@ output (pid_t pid)
glibtop_get_proc_time (&data.proc_time, pid);
- printf ("Proc_Time PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
+ printf ("Proc_Time PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_time.flags,
(unsigned long) data.proc_time.start_time,
(unsigned long) data.proc_time.rtime,
@@ -99,8 +100,8 @@ output (pid_t pid)
glibtop_get_proc_signal (&data.proc_signal, pid);
- printf ("Proc_Signal PID %5u (0x%08lx): "
- "%lu %lu %lu %lu\n", pid,
+ printf ("Proc_Signal PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu\n", (int) pid,
(unsigned long) data.proc_signal.flags,
(unsigned long) data.proc_signal.signal,
(unsigned long) data.proc_signal.blocked,
@@ -109,8 +110,8 @@ output (pid_t pid)
glibtop_get_proc_kernel (&data.proc_kernel, pid);
- printf ("Proc_Kernel PID %5u (0x%08lx): "
- "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", pid,
+ printf ("Proc_Kernel PID %5d (0x%08lx): "
+ "%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid,
(unsigned long) data.proc_kernel.flags,
(unsigned long) data.proc_kernel.k_flags,
(unsigned long) data.proc_kernel.min_flt,
diff --git a/include/glibtop/global.h b/include/glibtop/global.h
index e4c1d180..dbd4ab04 100644
--- a/include/glibtop/global.h
+++ b/include/glibtop/global.h
@@ -62,6 +62,10 @@
# endif
#endif
+#ifdef NEED_GNOMESUPPORT_H
+#include <gnomesupport.h>
+#endif
+
#ifdef WITHOUT_GUILE
#undef GLIBTOP_GUILE
#undef GLIBTOP_GUILE_NAMES
diff --git a/lib/init.c b/lib/init.c
index c5d3b6d6..4c494717 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -31,7 +31,7 @@
static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = &_glibtop_global_server;
-void
+static void
_init_server (glibtop *server, const unsigned features)
{
char *command, *temp;
diff --git a/lib/read_data.c b/lib/read_data.c
index f7ac86c9..713b4756 100644
--- a/lib/read_data.c
+++ b/lib/read_data.c
@@ -27,7 +27,7 @@
void *
glibtop_read_data_l (glibtop *server)
{
- size_t size;
+ size_t size;
void *ptr;
int ret;
@@ -38,9 +38,9 @@ glibtop_read_data_l (glibtop *server)
#endif
if (server->socket) {
- ret = recv (server->socket, &size, sizeof (size_t), 0);
+ ret = recv (server->socket, (void *)&size, sizeof (size_t), 0);
} else {
- ret = read (server->input [0], &size, sizeof (size_t));
+ ret = read (server->input [0], (void *)&size, sizeof (size_t));
}
if (ret < 0)