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]))
8402N/A+dnl Solaris msgfmt does not support the -c option so blank it.
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-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-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+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+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@@ -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 typedef struct _glibtop_map_entry glibtop_map_entry;
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 void glibtop_get_proc_mem(glibtop_proc_mem *buf, pid_t pid);
8402N/A@@ -39,6 +39,7 @@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALL
8402N/A+GMSGFMT_CHECKOPT = @GMSGFMT_CHECKOPT@
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@@ -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-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-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+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-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@@ -126,10 +126,10 @@ static const unsigned long _glibtop_sysd
8402N/A _glibtop_linux_get_fsusage_read_write(glibtop *server,
8402N/A- const char *path) G_GNUC_INTERNAL;
8402N/A _glibtop_get_fsusage_read_write(glibtop *server,
8402N/A@@ -141,7 +141,7 @@ _glibtop_get_fsusage_read_write(glibtop
8402N/A _glibtop_freebsd_get_fsusage_read_write(glibtop *server,
8402N/A libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
8402N/A@@ -36,6 +36,7 @@ static const unsigned long _glibtop_sysd
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_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/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-static const unsigned long _glibtop_sysdeps_netload = 0;
8402N/A+//#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
8402N/A+/* needed for IPV6 support */
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 /* HAVE_IFADDRS_H */
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+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+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+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+static const unsigned long _glibtop_sysdeps_netload_total =
8402N/A+(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
8402N/A+(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
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+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+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 glibtop_init_netload_s (glibtop *server)
8402N/A+ _glibtop_sysdeps_netload_bytes |
8402N/A+ _glibtop_sysdeps_netload_packets;
8402N/A+static void get_ipv6(glibtop *server, glibtop_netload *buf,
8402N/A+ struct ifaddrs *ifa0, *ifr6;
8402N/A+ if(getifaddrs (&ifa0) != 0)
8402N/A+ glibtop_warn_r(server, "getifaddrs failed : %s", g_strerror(errno));
8402N/A+ for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) {
8402N/A+ if (strcmp (ifr6->ifa_name, interface) == 0
8402N/A+ && ifr6->ifa_addr->sa_family == AF_INET6)
8402N/A+ &((struct sockaddr_in6 *) ifr6->ifa_addr)->sin6_addr,
8402N/A+ &((struct sockaddr_in6 *) ifr6->ifa_netmask)->sin6_addr,
8402N/A+ if (IN6_IS_ADDR_LINKLOCAL (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_LINK;
8402N/A+ else if (IN6_IS_ADDR_SITELOCAL (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_SITE;
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+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_GLOBAL;
8402N/A+ else if (IN6_IS_ADDR_LOOPBACK (buf->address6))
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_HOST;
8402N/A+ buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN;
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_6;
8402N/A+#endif /* HAVE_IFADDRS_H */
8402N/A+solaris_stats(glibtop *server,
8402N/A+ * chop off the trailing interface and
8402N/A+ ptr = module + strlen( module ) - 1;
8402N/A+ while( (ptr > module) && isdigit( (int) *ptr ) ) {
8402N/A+ * get a kstat handle and update the user's kstat chain
8402N/A+ if( (kctl = kstat_open()) == NULL ){
8402N/A+ glibtop_warn_io_r (server, "kstat_open ()");
8402N/A+ while( kstat_chain_update( kctl ) != 0 )
8402N/A+ * traverse the kstat chain
8402N/A+ * to find the appropriate statistics
8402N/A+ if( (ksp = kstat_lookup( kctl,
8402N/A+ module, 0, name )) == NULL ) {
8402N/A+ if( kstat_read( kctl, ksp, NULL ) == -1 ) {
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ipackets" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "opackets" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "rbytes" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "obytes" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ierrors" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "oerrors" );
8402N/A+ kdata = (kstat_named_t *) kstat_data_lookup( ksp, "collisions" );
8402N/A+ /* Compute total valules. */
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+ buf->flags |= _glibtop_sysdeps_netload;
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_bytes;
8402N/A+ buf->flags |= _glibtop_sysdeps_netload_packets;
8402N/A /* Provides network statistics. */
8402N/A glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
8402N/A- memset (buf, 0, sizeof (glibtop_netload));
8402N/A+ memset (buf, 0, sizeof (glibtop_netload));
8402N/A+ skfd = socket (PF_INET, SOCK_DGRAM, 0);
8402N/A+ if (ioctl (skfd, SIOCGIFFLAGS, &ifr) >= 0) {
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
8402N/A+ if (flags & IFF_BROADCAST)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
8402N/A+ if (flags & IFF_POINTOPOINT)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
8402N/A+ if (flags & IFF_MULTICAST)
8402N/A+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
8402N/A+ if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS);
8402N/A+ if (!ioctl (skfd, SIOCGIFNETMASK, &ifr)) {
8402N/A+ buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET);
8402N/A+ solaris_stats(server, buf, interface);
8402N/A+ get_ipv6(server, buf, interface);
8402N/A+#endif /* HAVE_IFADDRS_H */
8402N/A glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
8402N/A int fd, i, nmaps, pr_err, heap;
8575N/A #if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A struct ps_prochandle *Pr = NULL;
8402N/A buf->total = nmaps * sizeof(glibtop_map_entry);
8402N/A entry = g_malloc0(buf->total);
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A for(heap = 0,i = 0; i < nmaps; ++i)
8402N/A entry[i].start = maps[i].pr_vaddr;
8402N/A entry[i].end = maps[i].pr_vaddr + maps[i].pr_size;
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 entry[i].perm |= GLIBTOP_MAP_PERM_PRIVATE;
8402N/A entry[i].flags = _glibtop_sysdeps_map_entry;
8402N/A entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
8402N/A- if((len = resolvepath(buffer, entry[i].filename,
8402N/A- GLIBTOP_MAP_FILENAME_LEN)) > 0)
8402N/A- entry[i].filename[len] = 0;
8402N/A- entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
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+ rv = readlink(filename, entry[i].filename, sizeof(entry[i].filename) - 1);
8402N/A+ /* read object, if have not, set it as NULL */
8402N/A+ entry[i].filename[rv] = '\0';
8402N/A+ entry[i].flags |= (1L << GLIBTOP_MAP_ENTRY_FILENAME);
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8402N/A buf->flags = _glibtop_sysdeps_proc_map;
8402N/A@@ -59,9 +60,25 @@ glibtop_get_proc_mem_s (glibtop *server,
8402N/A+ maps = glibtop_get_proc_map_s(server, &mapbuf, pid);
8402N/A+ if (maps[i].perm & GLIBTOP_MAP_PERM_SHAREDMEMORY)
8402N/A+ buf->share += maps[i].shared_clean;
8402N/A buf->flags = _glibtop_sysdeps_proc_mem;
8402N/A+/* Copyright (C) 2006 Henry Zhang
8402N/A+ This file is part of LibGTop 2.14.
8402N/A+ Contributed by Henry Zhang <hua.zhang@sun.com>, July 2006.
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+ 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+ 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+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+glibtop_init_proc_open_files_s (glibtop *server)
8402N/A+/* Provides detailed information about a process' open files */
8402N/A+glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid)
8402N/A+ glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0);
8402N/A+ memset (buf, 0, sizeof (glibtop_proc_open_files));
8402N/A+ entries = g_array_new(FALSE, FALSE, sizeof(glibtop_open_files_entry));
8402N/A+ while((direntry = readdir(dir))) {
8402N/A+ glibtop_open_files_entry entry = {0};
8402N/A+ if(direntry->d_name[0] == '.')
8402N/A+ /* at /path, there are some dir which are not fd, so need to skip them */
8402N/A+ /* Clear error for atoi return */
8402N/A+ /* from /path get object name */
8402N/A+ g_snprintf(filename, sizeof filename, "/proc/%
d/path/%s",
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+ /* from /fd get the stat data */
8402N/A+ g_snprintf(filename, sizeof filename, "/proc/%
d/fd/%s",
8402N/A+ if(stat (filename, &statbuf))
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+ g_array_append_val(entries, entry);
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+ return (glibtop_open_files_entry*)g_array_free(entries, FALSE);
8402N/A@@ -31,6 +31,7 @@ const glibtop_signame glibtop_sys_siglis
8402N/A { 4, "SIGILL", "Illegal Instruction" },
8402N/A+ { 6, "SIGIOT", "IOT instruction" }, /* S8 also introduced */
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 { 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+#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+/* Copyright (C) 1998-99 Martin Baulig
8402N/A+ This file is part of LibGTop 1.0.
8402N/A+ Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
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+ 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+ 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+static const unsigned long _glibtop_sysdeps_sysinfo =
8402N/A+(1L << GLIBTOP_SYSINFO_CPUINFO);
8402N/A+static glibtop_sysinfo sysinfo = { .flags = 0 };
8402N/A+init_sysinfo (glibtop *server)
8402N/A+glibtop_get_sysinfo_s (glibtop *server)
8575N/A- /* Now let's have a bit of magic dust... */
8575N/A-#if GLIBTOP_SOLARIS_RELEASE >= 50600
8575N/A- func = dlsym(dl, "Pobjname"); /* Solaris 8 */
8575N/A- func = dlsym(dl, "proc_objname"); /* Solaris 7 */
8575N/A- (void *, uintptr_t, const char *, size_t))func;