libgtop-01-solaris.diff revision 8575
8575N/A--- libgtop-2.14.2/configure.in.orig 2006-07-29 17:39:00.191289000 +0100
8575N/A+++ libgtop-2.14.2/configure.in 2006-07-29 17:40:13.923035000 +0100
8575N/A@@ -164,6 +164,15 @@
8402N/A AC_CHECK_LIB(perfstat, vmgetinfo,
8402N/A AC_DEFINE(HAVE_VMGETINFO, 1,
8402N/A [Define to 1 if you have the 'vmgetinfo' function in libperfstat]))
8575N/A+
8402N/A+dnl Solaris msgfmt does not support the -c option so blank it.
8402N/A+GMSGFMT_CHECKOPT=-c
8402N/A+case "$host_os" in
8575N/A+ solaris*)
8575N/A+ GMSGFMT_CHECKOPT= ;;
8575N/A+ *) GMSGFMT_CHECKOPT=-c ;;
8402N/A+esac
8402N/A+AC_SUBST(GMSGFMT_CHECKOPT)
8402N/A
8402N/A dnl Solaris
8402N/A case "$host_os" in
8402N/Adiff -Nrup libgtop-2.14.1/include/glibtop/error.h libgtop-2.14.1.mod/include/glibtop/error.h
8402N/A--- libgtop-2.14.1/include/glibtop/error.h 2005-02-15 18:14:59.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/include/glibtop/error.h 2006-06-26 18:37:05.268278000 +0800
8402N/A@@ -33,20 +33,20 @@
8402N/A
8402N/A G_BEGIN_DECLS
8402N/A
8402N/A-void glibtop_error_vr (glibtop *server, const char *format, va_list args) G_GNUC_INTERNAL G_GNUC_NORETURN;
8402N/A-void glibtop_warn_vr (glibtop *server, const char *format, va_list args) G_GNUC_INTERNAL;
8402N/A-void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_INTERNAL G_GNUC_NORETURN;
8402N/A-void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_INTERNAL;
8402N/A-
8402N/A-void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
8402N/A-void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
8402N/A-void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
8402N/A-void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
8402N/A-
8402N/A-void glibtop_error (const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
8402N/A-void glibtop_warn (const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(1, 2);
8402N/A-void glibtop_error_io (const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
8402N/A-void glibtop_warn_io (const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(1, 2);
8402N/A+G_GNUC_INTERNAL void glibtop_error_vr (glibtop *server, const char *format, va_list args) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn_vr (glibtop *server, const char *format, va_list args) ;
8402N/A+G_GNUC_INTERNAL void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args) ;
8402N/A+
8402N/A+G_GNUC_INTERNAL void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
8402N/A+G_GNUC_INTERNAL void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
8402N/A+
8402N/A+G_GNUC_INTERNAL void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2);
8402N/A+G_GNUC_INTERNAL void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
8402N/A+G_GNUC_INTERNAL void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
8402N/A
8402N/A G_END_DECLS
8402N/A
8402N/Adiff -Nrup libgtop-2.14.1/include/glibtop/procmap.h libgtop-2.14.1.mod/include/glibtop/procmap.h
8402N/A--- libgtop-2.14.1/include/glibtop/procmap.h 2005-12-10 00:15:44.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/include/glibtop/procmap.h 2006-07-05 16:38:49.648816000 +0800
8402N/A@@ -60,6 +60,7 @@ G_BEGIN_DECLS
8402N/A #define GLIBTOP_MAP_PERM_EXECUTE 4
8402N/A #define GLIBTOP_MAP_PERM_SHARED 8
8402N/A #define GLIBTOP_MAP_PERM_PRIVATE 16
8402N/A+#define GLIBTOP_MAP_PERM_SHAREDMEMORY 32
8402N/A
8402N/A typedef struct _glibtop_map_entry glibtop_map_entry;
8402N/A
8402N/Adiff -Nrup libgtop-2.14.1/include/glibtop/procmem.h libgtop-2.14.1.mod/include/glibtop/procmem.h
8402N/A--- libgtop-2.14.1/include/glibtop/procmem.h 2005-06-07 17:54:43.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/include/glibtop/procmem.h 2006-05-29 11:56:43.561415000 +0800
8402N/A@@ -53,6 +53,7 @@ struct _glibtop_proc_mem
8402N/A rss, /* resident set size */
8402N/A rss_rlim; /* current limit (in bytes) of the rss
8402N/A * of the process; usually 2,147,483,647 */
8402N/A+ guint load; /* cpu load for process */
8402N/A };
8402N/A
8402N/A void glibtop_get_proc_mem(glibtop_proc_mem *buf, pid_t pid);
8402N/Adiff -Nrup libgtop-2.14.1/po/Makefile.in.in libgtop-2.14.1.mod/po/Makefile.in.in
8402N/A--- libgtop-2.14.1/po/Makefile.in.in 2006-04-10 18:26:15.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/po/Makefile.in.in 2006-06-23 17:45:57.201522000 +0800
8402N/A@@ -39,6 +39,7 @@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALL
8402N/A CC = @CC@
8402N/A GENCAT = @GENCAT@
8402N/A GMSGFMT = @GMSGFMT@
8402N/A+GMSGFMT_CHECKOPT = @GMSGFMT_CHECKOPT@
8402N/A MSGFMT = @MSGFMT@
8402N/A XGETTEXT = @XGETTEXT@
8402N/A MSGMERGE = msgmerge
8575N/A@@ -79,7 +79,7 @@
8402N/A
8402N/A .po.gmo:
8575N/A file=`echo $* | sed 's,.*/,,'`.gmo \
8575N/A- && rm -f $$file && $(GMSGFMT) -o $$file $<
8402N/A+ && rm -f $$file && $(GMSGFMT) -o $(GMSGFMT_CHECKOPT) $$file $<
8402N/A
8402N/A .po.cat:
8402N/A sed -f ../intl/po2msg.sed < $< > $*.msg \
8402N/Adiff -Nrup libgtop-2.14.1/src/daemon/daemon.h libgtop-2.14.1.mod/src/daemon/daemon.h
8402N/A--- libgtop-2.14.1/src/daemon/daemon.h 2006-04-02 17:10:00.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/src/daemon/daemon.h 2006-06-26 18:39:51.477653000 +0800
8402N/A@@ -59,17 +59,17 @@ G_BEGIN_DECLS
8402N/A #define MSG_BUFSZ sizeof (struct _glibtop_ipc_message)
8402N/A #define MSG_MSGSZ (MSG_BUFSZ - sizeof (long))
8402N/A
8402N/A-void handle_parent_connection (int s) G_GNUC_INTERNAL;
8402N/A-void handle_slave_connection (int input, int output) G_GNUC_INTERNAL;
8402N/A-void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
8402N/A- const void *parameter) G_GNUC_INTERNAL ;
8402N/A-
8402N/A-void do_output (int s, glibtop_response *resp, off_t offset,
8402N/A- size_t data_size, const void *data) G_GNUC_INTERNAL;
8402N/A-int do_read (int s, void *ptr, size_t total_size) G_GNUC_INTERNAL;
8402N/A+G_GNUC_INTERNAL void handle_parent_connection (int s) ;
8402N/A+G_GNUC_INTERNAL void handle_slave_connection (int input, int output) ;
8402N/A+G_GNUC_INTERNAL void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
8402N/A+ const void *parameter) ;
8402N/A+
8402N/A+G_GNUC_INTERNAL void do_output (int s, glibtop_response *resp, off_t offset,
8402N/A+ size_t data_size, const void *data) ;
8402N/A+G_GNUC_INTERNAL int do_read (int s, void *ptr, size_t total_size) ;
8402N/A
8402N/A-void syslog_message (int priority, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
8402N/A-void syslog_io_message (int priority, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
8402N/A+G_GNUC_INTERNAL void syslog_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3);
8402N/A+G_GNUC_INTERNAL void syslog_io_message (int priority, const char *format, ...) G_GNUC_PRINTF(2, 3);
8402N/A
8402N/A extern int enable_debug;
8402N/A extern int verbose_output;
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/common/fsusage.c libgtop-2.14.1.mod/sysdeps/common/fsusage.c
8402N/A--- libgtop-2.14.1/sysdeps/common/fsusage.c 2005-02-28 16:11:15.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/common/fsusage.c 2006-06-27 12:58:45.589444000 +0800
8402N/A@@ -126,10 +126,10 @@ static const unsigned long _glibtop_sysd
8402N/A */
8402N/A
8402N/A #ifdef linux
8402N/A-void
8402N/A+G_GNUC_INTERNAL void
8402N/A _glibtop_linux_get_fsusage_read_write(glibtop *server,
8402N/A glibtop_fsusage *buf,
8402N/A- const char *path) G_GNUC_INTERNAL;
8402N/A+ const char *path) ;
8402N/A
8402N/A static inline void
8402N/A _glibtop_get_fsusage_read_write(glibtop *server,
8402N/A@@ -141,7 +141,7 @@ _glibtop_get_fsusage_read_write(glibtop
8402N/A
8402N/A
8402N/A #elif defined(__FreeBSD__)
8402N/A-void G_GNUC_INTERNAL
8402N/A+G_GNUC_INTERNAL void
8402N/A _glibtop_freebsd_get_fsusage_read_write(glibtop *server,
8402N/A glibtop_fsusage *buf,
8402N/A const char *path);
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/Makefile.am libgtop-2.14.1.mod/sysdeps/solaris/Makefile.am
8402N/A--- libgtop-2.14.1/sysdeps/solaris/Makefile.am 2004-11-13 08:53:20.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/Makefile.am 2006-06-26 16:29:13.805833000 +0800
8402N/A@@ -8,6 +8,7 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c
8402N/A proclist.c procstate.c procuid.c \
8402N/A proctime.c procmem.c procsignal.c \
8402N/A prockernel.c procsegment.c procargs.c \
8402N/A+ procopenfiles.c sysinfo.c \
8402N/A procmap.c netload.c ppp.c procdata.c netlist.c
8402N/A
8402N/A libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/cpu.c libgtop-2.14.1.mod/sysdeps/solaris/cpu.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/cpu.c 2005-12-12 18:09:40.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/cpu.c 2006-06-27 18:59:31.656908000 +0800
8402N/A@@ -36,6 +36,7 @@ static const unsigned long _glibtop_sysd
8402N/A
8402N/A static const unsigned long _glibtop_sysdeps_cpu_all =
8402N/A (1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
8402N/A+(1L << GLIBTOP_CPU_NICE) +
8402N/A (1L << GLIBTOP_CPU_SYS) + (1L << GLIBTOP_CPU_IDLE) +
8402N/A (1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
8402N/A (1L << GLIBTOP_XCPU_SYS) + (1L << GLIBTOP_XCPU_IDLE) +
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/glibtop_machine.h libgtop-2.14.1.mod/sysdeps/solaris/glibtop_machine.h
8402N/A--- libgtop-2.14.1/sysdeps/solaris/glibtop_machine.h 2004-06-10 02:52:22.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/glibtop_machine.h 2006-07-16 19:03:50.987999000 +0800
8575N/A@@ -63,14 +63,8 @@
8402N/A int pagesize; /* in bits to shift, ie. 2^pagesize gives Kb */
8402N/A int ticks; /* clock ticks, as returned by sysconf() */
8402N/A unsigned long long boot; /* boot time, although it's ui32 in kstat */
8402N/A- void *libproc; /* libproc handle */
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A- void (*objname)(void *, uintptr_t, const char *, size_t);
8402N/A- struct ps_prochandle *(*pgrab)(pid_t, int, int *);
8402N/A- void (*pfree)(void *);
8402N/A-#else
8402N/A+
8402N/A void *filler[3];
8402N/A-#endif
8402N/A };
8402N/A
8402N/A G_END_DECLS
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/netload.c libgtop-2.14.1.mod/sysdeps/solaris/netload.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/netload.c 2005-12-12 18:09:40.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/netload.c 2006-06-29 13:48:31.638982000 +0800
8402N/A@@ -26,14 +26,243 @@
8402N/A #include <glibtop/error.h>
8402N/A #include <glibtop/netload.h>
8402N/A
8402N/A-static const unsigned long _glibtop_sysdeps_netload = 0;
8402N/A+#include "glibtop_private.h"
8402N/A+
8402N/A+#include <errno.h>
8402N/A+#include <string.h>
8402N/A+
8402N/A+#include <sys/types.h>
8402N/A+#include <sys/socket.h>
8402N/A+#include <sys/ioctl.h>
8402N/A+#include <sys/sockio.h>
8402N/A+
8402N/A+//#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
8402N/A+/* GNU LibC */
8402N/A+#include <net/if.h>
8402N/A+
8402N/A+#ifdef HAVE_IFADDRS_H
8402N/A+/* needed for IPV6 support */
8402N/A+
8402N/A+#include <ifaddrs.h>
8402N/A+
8402N/A+#ifndef IN6_IS_ADDR_GLOBAL
8402N/A+#define IN6_IS_ADDR_GLOBAL(a) \
8402N/A+ (((((__const uint8_t *) (a))[0] & 0xff) == 0x3f \
8402N/A+ || (((__const uint8_t *) (a))[0] & 0xff) == 0x20))
8402N/A+#endif
8402N/A+#endif /* HAVE_IFADDRS_H */
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload =
8402N/A+(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
8402N/A+(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
8402N/A+(1L << GLIBTOP_NETLOAD_COLLISIONS);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_data =
8402N/A+(1L << GLIBTOP_NETLOAD_ADDRESS) +
8402N/A+(1L << GLIBTOP_NETLOAD_SUBNET) +
8402N/A+(1L << GLIBTOP_NETLOAD_MTU);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_bytes =
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_IN) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_packets =
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_total =
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_in =
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_IN);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_out =
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_OUT);
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_netload_6 =
8402N/A+(1L << GLIBTOP_NETLOAD_ADDRESS6) +
8402N/A+(1L << GLIBTOP_NETLOAD_PREFIX6) +
8402N/A+(1L << GLIBTOP_NETLOAD_SCOPE6);
8402N/A+
8402N/A
8402N/A /* Init function. */
8402N/A
8402N/A void
8402N/A glibtop_init_netload_s (glibtop *server)
8402N/A {
8402N/A- server->sysdeps.netload = _glibtop_sysdeps_netload;
8402N/A+ server->sysdeps.netload = _glibtop_sysdeps_netload |
8402N/A+ _glibtop_sysdeps_netload_bytes |
8402N/A+ _glibtop_sysdeps_netload_packets;
8402N/A+}
8402N/A+
8402N/A+
8402N/A+#ifdef HAVE_IFADDRS_H
8402N/A+
8402N/A+static void get_ipv6(glibtop *server, glibtop_netload *buf,
8402N/A+ const char *interface)
8402N/A+{
8402N/A+ struct ifaddrs *ifa0, *ifr6;
8402N/A+
8402N/A+ if(getifaddrs (&ifa0) != 0)
8402N/A+ {
8402N/A+ glibtop_warn_r(server, "getifaddrs failed : %s", g_strerror(errno));
8402N/A+ return;
8402N/A+ }
8402N/A+
8402N/A+ for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) {
8402N/A+ if (strcmp (ifr6->ifa_name, interface) == 0
8402N/A+ && ifr6->ifa_addr != NULL
8402N/A+ && ifr6->ifa_addr->sa_family == AF_INET6)
8402N/A+ break;
8402N/A+ }
8402N/A+
8402N/A+ if(!ifr6) goto free_ipv6;
8402N/A+
8402N/A+ memcpy(buf->address6,
8402N/A+ &((struct sockaddr_in6 *) ifr6->ifa_addr)->sin6_addr,
8402N/A+ 16);
8402N/A+
8402N/A+ memcpy(buf->prefix6,
8402N/A+ &((struct sockaddr_in6 *) ifr6->ifa_netmask)->sin6_addr,
8402N/A+ 16);
8402N/A+
8402N/A+
8402N/A+ if (IN6_IS_ADDR_LINKLOCAL (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_LINK;
8402N/A+
8402N/A+ else if (IN6_IS_ADDR_SITELOCAL (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE;
8402N/A+
8402N/A+ else if (IN6_IS_ADDR_GLOBAL (buf->address6)
8402N/A+ || IN6_IS_ADDR_MC_ORGLOCAL (buf->address6)
8402N/A+ || IN6_IS_ADDR_V4COMPAT (buf->address6)
8402N/A+ || IN6_IS_ADDR_MULTICAST (buf->address6)
8402N/A+ || IN6_IS_ADDR_UNSPECIFIED (buf->address6)
8402N/A+ )
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_GLOBAL;
8402N/A+
8402N/A+ else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST;
8402N/A+
8402N/A+ else
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN;
8402N/A+
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_6;
8402N/A+
8402N/A+ free_ipv6:
8402N/A+ freeifaddrs(ifa0);
8402N/A+}
8402N/A+
8402N/A+#endif /* HAVE_IFADDRS_H */
8402N/A+
8402N/A+
8402N/A+
8402N/A+static int
8402N/A+solaris_stats(glibtop *server,
8402N/A+ glibtop_netload *buf,
8402N/A+ const char *interface)
8402N/A+{
8402N/A+ char *name = interface;
8402N/A+ char *module;
8402N/A+ char *ptr;
8402N/A+ kstat_ctl_t *kctl;
8402N/A+ kstat_t *ksp;
8402N/A+ kstat_named_t *kdata;
8402N/A+ int have_bytes = 1;
8402N/A+
8402N/A+ /*
8402N/A+ * chop off the trailing interface and
8402N/A+ */
8402N/A+ module = strdup( name );
8402N/A+ ptr = module + strlen( module ) - 1;
8402N/A+ while( (ptr > module) && isdigit( (int) *ptr ) ) {
8402N/A+ *ptr = '\0';
8402N/A+ ptr--;
8402N/A+ }
8402N/A+
8402N/A+ /*
8402N/A+ * get a kstat handle and update the user's kstat chain
8402N/A+ */
8402N/A+ if( (kctl = kstat_open()) == NULL ){
8402N/A+ glibtop_warn_io_r (server, "kstat_open ()");
8402N/A+ free( module );
8402N/A+ return( 0 );
8402N/A+ }
8402N/A+ while( kstat_chain_update( kctl ) != 0 )
8402N/A+ ;
8402N/A+
8402N/A+ /*
8402N/A+ * traverse the kstat chain
8402N/A+ * to find the appropriate statistics
8402N/A+ */
8402N/A+ if( (ksp = kstat_lookup( kctl,
8402N/A+ module, 0, name )) == NULL ) {
8402N/A+ free( module );
8402N/A+ kstat_close(kctl);
8402N/A+ return( 0 );
8402N/A+ }
8402N/A+ if( kstat_read( kctl, ksp, NULL ) == -1 ) {
8402N/A+ free( module );
8402N/A+ kstat_close(kctl);
8402N/A+ return( 0 );
8402N/A+ }
8402N/A+ free( module );
8402N/A+
8402N/A+ /*
8402N/A+ * lookup & store the data
8402N/A+ */
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ipackets" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->packets_in= kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "opackets" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->packets_out = kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "rbytes" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->bytes_in =kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "obytes" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->bytes_out =kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ierrors" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->errors_in = kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "oerrors" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->errors_out = kdata->value.ul;
8402N/A+ }
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "collisions" );
8402N/A+ if( kdata != NULL ) {
8402N/A+ buf->collisions = kdata->value.ul;
8402N/A+ }
8402N/A+
8402N/A+ /* Compute total valules. */
8402N/A+
8402N/A+ buf->bytes_total = buf->bytes_in + buf->bytes_out;
8402N/A+ buf->packets_total = buf->packets_in + buf->packets_out;
8402N/A+ buf->errors_total = buf->errors_in + buf->errors_out;
8402N/A+ /* And now the flags. */
8402N/A+ buf->flags |= _glibtop_sysdeps_netload;
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_bytes;
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_packets;
8402N/A+
8402N/A+ kstat_close(kctl);
8402N/A+
8402N/A+ /* finished */
8402N/A+
8402N/A }
8402N/A
8402N/A /* Provides network statistics. */
8402N/A@@ -42,5 +271,73 @@ void
8402N/A glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
8402N/A const char *interface)
8402N/A {
8402N/A- memset (buf, 0, sizeof (glibtop_netload));
8402N/A+ int skfd;
8402N/A+ memset (buf, 0, sizeof (glibtop_netload));
8402N/A+
8402N/A+ /* set flag */
8402N/A+ skfd = socket (PF_INET, SOCK_DGRAM, 0);
8402N/A+ if (skfd) {
8402N/A+ struct ifreq ifr;
8402N/A+
8402N/A+ g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name);
8402N/A+ if (ioctl (skfd, SIOCGIFFLAGS, &ifr) >= 0) {
8402N/A+ const unsigned long long flags = ifr.ifr_flags;
8402N/A+
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
8402N/A+
8402N/A+ if (flags & IFF_UP)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
8402N/A+
8402N/A+ if (flags & IFF_BROADCAST)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
8402N/A+
8402N/A+ if (flags & IFF_DEBUG)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
8402N/A+
8402N/A+ if (flags & IFF_LOOPBACK)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
8402N/A+
8402N/A+ if (flags & IFF_POINTOPOINT)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
8402N/A+
8402N/A+ if (flags & IFF_RUNNING)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
8402N/A+
8402N/A+ if (flags & IFF_NOARP)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
8402N/A+
8402N/A+ if (flags & IFF_PROMISC)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
8402N/A+
8402N/A+ if (flags & IFF_ALLMULTI)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
8402N/A+
8402N/A+ if (flags & IFF_MULTICAST)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
8402N/A+ }
8402N/A+
8402N/A+ g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name);
8402N/A+ if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
8402N/A+ buf->address = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr;
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS);
8402N/A+ }
8402N/A+
8402N/A+ g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name);
8402N/A+ if (!ioctl (skfd, SIOCGIFNETMASK, &ifr)) {
8402N/A+ buf->subnet = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr;
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET);
8402N/A+ }
8402N/A+ close (skfd);
8402N/A+ }
8402N/A+
8402N/A+ /*
8402N/A+ * Statistics
8402N/A+ */
8402N/A+
8402N/A+ solaris_stats(server, buf, interface);
8402N/A+
8402N/A+#ifdef HAVE_IFADDRS_H
8402N/A+ get_ipv6(server, buf, interface);
8402N/A+#endif /* HAVE_IFADDRS_H */
8402N/A }
8402N/A+
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/procmap.c libgtop-2.14.1.mod/sysdeps/solaris/procmap.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/procmap.c 2005-12-12 18:09:40.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/procmap.c 2006-07-16 18:17:06.131563000 +0800
8575N/A@@ -56,6 +56,7 @@
8402N/A glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
8402N/A {
8402N/A int fd, i, nmaps, pr_err, heap;
8402N/A+ char filename [BUFSIZ];
8575N/A #if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A prxmap_t *maps;
8402N/A struct ps_prochandle *Pr = NULL;
8575N/A@@ -125,15 +125,9 @@
8402N/A buf->total = nmaps * sizeof(glibtop_map_entry);
8402N/A entry = g_malloc0(buf->total);
8402N/A
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A-
8402N/A- if(server->machine.objname && server->machine.pgrab &&
8402N/A- server->machine.pfree)
8402N/A- Pr = (server->machine.pgrab)(pid, 1, &pr_err);
8402N/A-#endif
8402N/A for(heap = 0,i = 0; i < nmaps; ++i)
8402N/A {
8402N/A- int len;
8402N/A+ int len, rv;
8402N/A
8402N/A entry[i].start = maps[i].pr_vaddr;
8402N/A entry[i].end = maps[i].pr_vaddr + maps[i].pr_size;
8575N/A@@ -158,6 +152,10 @@
8402N/A entry[i].perm |= GLIBTOP_MAP_PERM_EXECUTE;
8402N/A if(maps[i].pr_mflags & MA_SHARED)
8402N/A entry[i].perm |= GLIBTOP_MAP_PERM_SHARED;
8402N/A+ if(maps[i].pr_mflags & (MA_SHM|MA_ISM)){
8575N/A+ entry[i].perm |= GLIBTOP_MAP_PERM_SHAREDMEMORY;
8575N/A+ entry[i].shared_clean = maps[i].pr_size; /* here use shared_clean to store Shared Memory */
8402N/A+ }
8402N/A else
8402N/A entry[i].perm |= GLIBTOP_MAP_PERM_PRIVATE;
8402N/A entry[i].flags = _glibtop_sysdeps_map_entry;
8575N/A@@ -179,25 +177,22 @@
8402N/A entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
8402N/A }
8402N/A else
8402N/A- if(Pr)
8402N/A- {
8402N/A- server->machine.objname(Pr, maps[i].pr_vaddr, buffer,
8402N/A- BUFSIZ);
8402N/A- if((len = resolvepath(buffer, entry[i].filename,
8402N/A- GLIBTOP_MAP_FILENAME_LEN)) > 0)
8402N/A- {
8402N/A- entry[i].filename[len] = 0;
8402N/A- entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
8402N/A- }
8402N/A- }
8402N/A+ {
8402N/A+ strcpy(buffer, maps[i].pr_mapname);
8402N/A+ /* from /path get file name */
8575N/A+ g_snprintf(filename, sizeof filename, "/proc/%d/path/%s", pid, buffer);
8402N/A+
8402N/A+ rv = readlink(filename, entry[i].filename, sizeof(entry[i].filename) - 1);
8402N/A+ /* read object, if have not, set it as NULL */
8402N/A+ if(rv < 0)
8402N/A+ rv = 0;
8402N/A+ entry[i].filename[rv] = '\0';
8575N/A+ /* now set the flags */
8402N/A+ entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
8402N/A+ }
8402N/A #endif
8402N/A }
8402N/A
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A-
8402N/A- if(Pr)
8402N/A- server->machine.pfree(Pr);
8402N/A-#endif
8402N/A buf->flags = _glibtop_sysdeps_proc_map;
8402N/A s_close(fd);
8402N/A return entry;
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/procmem.c libgtop-2.14.1.mod/sysdeps/solaris/procmem.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/procmem.c 2005-12-12 18:09:40.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/procmem.c 2006-07-04 17:07:05.687415000 +0800
8402N/A@@ -24,6 +24,7 @@
8402N/A #include <config.h>
8402N/A #include <glibtop.h>
8402N/A #include <glibtop/procmem.h>
8402N/A+#include <glibtop/procmap.h>
8402N/A
8402N/A #include "glibtop_private.h"
8402N/A
8402N/A@@ -59,9 +60,25 @@ glibtop_get_proc_mem_s (glibtop *server,
8402N/A #ifdef HAVE_PROCFS_H
8402N/A buf->size = buf->vsize = psinfo.pr_size << 10;
8402N/A buf->resident = buf->rss = psinfo.pr_rssize << 10;
8402N/A+ buf->load = (guint) psinfo.pr_lwp.pr_pctcpu * 100 / (guint) 0x8000;
8402N/A #else
8402N/A buf->size = buf->vsize = psinfo.pr_size << pagesize << 10;
8402N/A buf->resident = buf->rss = psinfo.pr_rssize << pagesize << 10;
8402N/A+ buf->load = (guint) psinfo.pr_lwp.pr_pctcpu * 100 / (guint) 0x8000;
8402N/A #endif
8402N/A+/* get Shared Memory */
8402N/A+ glibtop_proc_map mapbuf;
8402N/A+ glibtop_map_entry *maps;
8402N/A+ unsigned i;
8402N/A+ buf->share = 0;
8402N/A+
8402N/A+ maps = glibtop_get_proc_map_s(server, &mapbuf, pid);
8402N/A+
8402N/A+ for (i = 0; i < mapbuf.number; ++i) {
8402N/A+ if (maps[i].perm & GLIBTOP_MAP_PERM_SHAREDMEMORY)
8402N/A+ buf->share += maps[i].shared_clean;
8402N/A+ }
8402N/A+ g_free(maps);
8402N/A+
8402N/A buf->flags = _glibtop_sysdeps_proc_mem;
8402N/A }
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/procopenfiles.c libgtop-2.14.1.mod/sysdeps/solaris/procopenfiles.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/procopenfiles.c 1970-01-01 08:00:00.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/procopenfiles.c 2006-07-10 10:26:16.615449000 +0800
8402N/A@@ -0,0 +1,134 @@
8402N/A+/* $Id: procopenfiles.c,v 1.7 2005/12/12 09:38:12 jamesh Exp $ */
8402N/A+
8402N/A+/* Copyright (C) 2006 Henry Zhang
8402N/A+ This file is part of LibGTop 2.14.
8402N/A+
8402N/A+ Contributed by Henry Zhang <hua.zhang@sun.com>, July 2006.
8402N/A+
8402N/A+ LibGTop is free software; you can redistribute it and/or modify it
8402N/A+ under the terms of the GNU General Public License as published by
8402N/A+ the Free Software Foundation; either version 2 of the License,
8402N/A+ or (at your option) any later version.
8402N/A+
8402N/A+ LibGTop is distributed in the hope that it will be useful, but WITHOUT
8402N/A+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8402N/A+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8402N/A+ for more details.
8402N/A+
8402N/A+ You should have received a copy of the GNU General Public License
8402N/A+ along with LibGTop; see the file COPYING. If not, write to the
8402N/A+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
8402N/A+ Boston, MA 02111-1307, USA.
8402N/A+*/
8402N/A+
8402N/A+#include <config.h>
8402N/A+#include <glibtop.h>
8402N/A+#include <glibtop/error.h>
8402N/A+#include <glibtop/procopenfiles.h>
8402N/A+#include <sys/types.h>
8402N/A+#include <fcntl.h>
8402N/A+#include <sys/stat.h>
8402N/A+#include <dirent.h>
8402N/A+#include <string.h>
8402N/A+#include <stdio.h>
8402N/A+
8402N/A+#include "glibtop_private.h"
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_proc_open_files =
8402N/A+(1L << GLIBTOP_PROC_OPEN_FILES_NUMBER)|
8402N/A+(1L << GLIBTOP_PROC_OPEN_FILES_TOTAL)|
8402N/A+(1L << GLIBTOP_PROC_OPEN_FILES_SIZE);
8402N/A+
8402N/A+/* Init function. */
8402N/A+
8402N/A+void
8402N/A+glibtop_init_proc_open_files_s (glibtop *server)
8402N/A+{
8402N/A+ server->sysdeps.proc_open_files = _glibtop_sysdeps_proc_open_files;
8402N/A+}
8402N/A+
8402N/A+
8402N/A+
8402N/A+/* Provides detailed information about a process' open files */
8402N/A+
8402N/A+glibtop_open_files_entry *
8402N/A+glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid)
8402N/A+{
8402N/A+ char filename [BUFSIZ];
8402N/A+ GArray *entries;
8402N/A+ struct dirent *direntry;
8402N/A+ DIR *dir;
8402N/A+ int errno;
8402N/A+
8402N/A+ glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0);
8402N/A+
8402N/A+ memset (buf, 0, sizeof (glibtop_proc_open_files));
8402N/A+
8402N/A+ sprintf (filename, "/proc/%d/fd", pid);
8402N/A+
8402N/A+ dir = opendir (filename);
8402N/A+ if (!dir) return NULL;
8402N/A+
8402N/A+ entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry));
8402N/A+
8402N/A+ while((direntry = readdir(dir))) {
8402N/A+ char tgt [BUFSIZ];
8402N/A+ int rv;
8402N/A+ glibtop_open_files_entry entry = {0};
8402N/A+ struct stat statbuf;
8402N/A+
8402N/A+ if(direntry->d_name[0] == '.')
8402N/A+ continue;
8402N/A+ /* at /path, there are some dir which are not fd, so need to skip them */
8402N/A+
8402N/A+ /* Clear error for atoi return */
8402N/A+ errno = 0;
8402N/A+ entry.fd = atoi(direntry->d_name);
8402N/A+ if (entry.fd == 0 && errno != 0)
8402N/A+ continue;
8402N/A+
8402N/A+ /* from /path get object name */
8402N/A+ g_snprintf(filename, sizeof filename, "/proc/%d/path/%s",
8402N/A+ pid, direntry->d_name);
8402N/A+
8402N/A+ rv = readlink(filename, tgt, sizeof(tgt) - 1);
8402N/A+ /* read object, if not have, set it as NULL, but this fd still need to insert into the array */
8402N/A+ if(rv < 0)
8402N/A+ rv = 0;
8402N/A+ tgt[rv] = '\0';
8402N/A+
8402N/A+ /* from /fd get the stat data */
8402N/A+ g_snprintf(filename, sizeof filename, "/proc/%d/fd/%s",
8402N/A+ pid, direntry->d_name);
8402N/A+
8402N/A+ if(stat (filename, &statbuf))
8402N/A+ statbuf.st_mode = 0;
8402N/A+
8402N/A+ switch (statbuf.st_mode & S_IFMT) {
8402N/A+ case S_IFIFO: /* pipe */
8402N/A+ entry.type = GLIBTOP_FILE_TYPE_PIPE;
8402N/A+ break;
8402N/A+ case S_IFSOCK: /* socket */
8402N/A+ /* at solaris, now a little difficult to tell the Socket type, so here I
8402N/A+ give the type 0, it will not impact the existed code. Later will provide
8402N/A+ a patch to tell the type, and get the object name */
8402N/A+ entry.type = 0;
8402N/A+ break;
8402N/A+ default:
8402N/A+ entry.type = GLIBTOP_FILE_TYPE_FILE;
8402N/A+ }
8402N/A+
8402N/A+ g_strlcpy(entry.info.file.name, tgt, sizeof entry.info.file.name);
8402N/A+
8402N/A+ g_array_append_val(entries, entry);
8402N/A+ }
8402N/A+
8402N/A+ closedir (dir);
8402N/A+
8402N/A+ buf->flags = _glibtop_sysdeps_proc_open_files;
8402N/A+ buf->number = entries->len;
8402N/A+ buf->size = sizeof(glibtop_open_files_entry);
8402N/A+ buf->total = buf->number * buf->size;
8402N/A+
8402N/A+ return (glibtop_open_files_entry*)g_array_free(entries, FALSE);
8402N/A+}
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/siglist.c libgtop-2.14.1.mod/sysdeps/solaris/siglist.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/siglist.c 2005-12-12 18:09:40.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/siglist.c 2006-07-03 16:29:22.390261000 +0800
8402N/A@@ -31,6 +31,7 @@ const glibtop_signame glibtop_sys_siglis
8402N/A { 3, "SIGQUIT", "Quit" },
8402N/A { 4, "SIGILL", "Illegal Instruction" },
8402N/A { 5, "SIGTRAP", "Trace/Breakpoint Trap" },
8402N/A+ { 6, "SIGIOT", "IOT instruction" }, /* S8 also introduced */
8402N/A { 6, "SIGABRT", "Abort" },
8402N/A { 7, "SIGEMT", "Emulation Trap" },
8402N/A { 8, "SIGFPE", "Arithmetic Exception" },
8402N/A@@ -43,6 +44,7 @@ const glibtop_signame glibtop_sys_siglis
8402N/A { 15, "SIGTERM", "Terminated" },
8402N/A { 16, "SIGUSR1", "User Signal 1" },
8402N/A { 17, "SIGUSR2", "User Signal 2" },
8402N/A+ { 18, "SIGCLD", "Child Status Changed" },/* S8 also introduced */
8402N/A { 18, "SIGCHLD", "Child Status Changed" },
8402N/A { 19, "SIGPWR", "Power-Fail/Restart" },
8402N/A { 20, "SIGWINCH","Window Size Change" },
8402N/A@@ -63,6 +65,7 @@ const glibtop_signame glibtop_sys_siglis
8402N/A { 35, "SIGTHAW", "Checkpoint Thaw" },
8402N/A { 36, "SIGCANCEL","Thread Cancelation" },
8402N/A { 37, "SIGLOST", "Resource Lost" },
8402N/A+#if GLIBTOP_SOLARIS_RELEASE < 50900 /* S8 */
8402N/A { 38, "SIGRTMIN","First Realtime Signal" },
8402N/A { 39, "SIGRTMIN+1", "Second Realtime Signal" },
8402N/A { 40, "SIGRTMIN+2", "Third Realtime Signal" },
8402N/A@@ -71,5 +74,30 @@ const glibtop_signame glibtop_sys_siglis
8402N/A { 43, "SIGRTMAX-2", "Third Last Realtime Signal" },
8402N/A { 44, "SIGRTMAX-1", "Second Last Realtime Signal" },
8402N/A { 45, "SIGRTMAX", "Last Realtime Signal" },
8402N/A+#endif
8402N/A+#if GLIBTOP_SOLARIS_RELEASE >= 50900
8402N/A+ { 38, "SIGXRES","Resource Control Exceeded" },
8402N/A+#if GLIBTOP_SOLARIS_RELEASE <51000 /* signal here existed in s9 */
8402N/A+ { 39, "SIGRTMIN","First Realtime Signal" },
8402N/A+ { 40, "SIGRTMIN+1", "Second Realtime Signal" },
8402N/A+ { 41, "SIGRTMIN+2", "Third Realtime Signal" },
8402N/A+ { 42, "SIGRTMIN+3", "Fourth Realtime Signal" },
8402N/A+ { 43, "SIGRTMAX-3", "Fourth Last Realtime Signal" },
8402N/A+ { 44, "SIGRTMAX-2", "Third Last Realtime Signal" },
8402N/A+ { 45, "SIGRTMAX-1", "Second Last Realtime Signal" },
8402N/A+ { 46, "SIGRTMAX", "Last Realtime Signal" },
8402N/A+#else /* signal here existed in s10 and s11 */
8402N/A+ { 39, "SIGJVM1","Reserved signal for Java Virtual Machine" },
8402N/A+ { 40, "SIGJVM1","Reserved signal for Java Virtual Machine" },
8402N/A+ { 41, "SIGRTMIN","First Realtime Signal" },
8402N/A+ { 42, "SIGRTMIN+1", "Second Realtime Signal" },
8402N/A+ { 43, "SIGRTMIN+2", "Third Realtime Signal" },
8402N/A+ { 44, "SIGRTMIN+3", "Fourth Realtime Signal" },
8402N/A+ { 45, "SIGRTMAX-3", "Fourth Last Realtime Signal" },
8402N/A+ { 46, "SIGRTMAX-2", "Third Last Realtime Signal" },
8402N/A+ { 47, "SIGRTMAX-1", "Second Last Realtime Signal" },
8402N/A+ { 48, "SIGRTMAX", "Last Realtime Signal" },
8402N/A+#endif
8402N/A+#endif
8402N/A { 0, NULL, NULL }
8402N/A };
8402N/Adiff -Nrup libgtop-2.14.1/sysdeps/solaris/sysinfo.c libgtop-2.14.1.mod/sysdeps/solaris/sysinfo.c
8402N/A--- libgtop-2.14.1/sysdeps/solaris/sysinfo.c 1970-01-01 08:00:00.000000000 +0800
8402N/A+++ libgtop-2.14.1.mod/sysdeps/solaris/sysinfo.c 2006-07-03 10:50:14.165481000 +0800
8402N/A@@ -0,0 +1,48 @@
8402N/A+/* $Id: sysinfo.c,v 1.22 2004/11/28 01:32:55 bdejean Exp $ */
8402N/A+
8402N/A+/* Copyright (C) 1998-99 Martin Baulig
8402N/A+ This file is part of LibGTop 1.0.
8402N/A+
8402N/A+ Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
8402N/A+
8402N/A+ LibGTop is free software; you can redistribute it and/or modify it
8402N/A+ under the terms of the GNU General Public License as published by
8402N/A+ the Free Software Foundation; either version 2 of the License,
8402N/A+ or (at your option) any later version.
8402N/A+
8402N/A+ LibGTop is distributed in the hope that it will be useful, but WITHOUT
8402N/A+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8402N/A+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8402N/A+ for more details.
8402N/A+
8402N/A+ You should have received a copy of the GNU General Public License
8402N/A+ along with LibGTop; see the file COPYING. If not, write to the
8402N/A+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
8402N/A+ Boston, MA 02111-1307, USA.
8402N/A+*/
8402N/A+
8402N/A+#include <config.h>
8402N/A+#include <glibtop/error.h>
8402N/A+#include <glibtop/cpu.h>
8402N/A+#include <glibtop/sysinfo.h>
8402N/A+
8402N/A+#include "glibtop_private.h"
8402N/A+
8402N/A+
8402N/A+static const unsigned long _glibtop_sysdeps_sysinfo =
8402N/A+(1L << GLIBTOP_SYSINFO_CPUINFO);
8402N/A+
8402N/A+static glibtop_sysinfo sysinfo = { .flags = 0 };
8402N/A+
8402N/A+static void
8402N/A+init_sysinfo (glibtop *server)
8402N/A+{
8402N/A+
8402N/A+}
8402N/A+
8402N/A+const glibtop_sysinfo *
8402N/A+glibtop_get_sysinfo_s (glibtop *server)
8402N/A+{
8402N/A+ init_sysinfo (server);
8402N/A+ return &sysinfo;
8402N/A+}
8575N/A--- libgtop-2.14.2/sysdeps/solaris/open.c.orig 2006-07-29 17:53:58.468281000 +0100
8575N/A+++ libgtop-2.14.2/sysdeps/solaris/open.c 2006-07-29 17:55:15.197762000 +0100
8575N/A@@ -211,34 +211,5 @@
8575N/A }
8575N/A }
8575N/A
8575N/A- /* Now let's have a bit of magic dust... */
8575N/A-
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8575N/A-
8575N/A- dl = dlopen("/usr/lib/libproc.so", RTLD_LAZY);
8575N/A- if(server->machine.libproc)
8575N/A- dlclose(server->machine.libproc);
8575N/A- server->machine.libproc = dl;
8575N/A- if(dl)
8575N/A- {
8575N/A- void *func;
8575N/A-
8575N/A- func = dlsym(dl, "Pobjname"); /* Solaris 8 */
8575N/A- if(!func)
8575N/A- func = dlsym(dl, "proc_objname"); /* Solaris 7 */
8575N/A- server->machine.objname = (void (*)
8575N/A- (void *, uintptr_t, const char *, size_t))func;
8575N/A- server->machine.pgrab = (struct ps_prochandle *(*)(pid_t, int, int *))
8575N/A- dlsym(dl, "Pgrab");
8575N/A- server->machine.pfree = (void (*)(void *))dlsym(dl, "Pfree");
8575N/A-
8575N/A- }
8575N/A- else
8575N/A- {
8575N/A- server->machine.objname = NULL;
8575N/A- server->machine.pgrab = NULL;
8575N/A- server->machine.pfree = NULL;
8575N/A- }
8575N/A-#endif
8575N/A server->machine.me = getpid();
8575N/A }