Use (1L << feature)' instead of
(1 << feature)' to avoid problems
with integer overflows when we add more fields.
This commit is contained in:
@@ -97,7 +97,7 @@ main (int argc, char *argv [])
|
|||||||
unsigned device, device_major, device_minor;
|
unsigned device, device_major, device_minor;
|
||||||
char perm [5];
|
char perm [5];
|
||||||
|
|
||||||
if (maps [i].flags & (1 << GLIBTOP_MAP_ENTRY_FILENAME))
|
if (maps [i].flags & (1L << GLIBTOP_MAP_ENTRY_FILENAME))
|
||||||
filename = maps [i].filename;
|
filename = maps [i].filename;
|
||||||
|
|
||||||
#ifdef GLIBTOP_INODEDB
|
#ifdef GLIBTOP_INODEDB
|
||||||
|
@@ -69,7 +69,7 @@ main (int argc, char *argv [])
|
|||||||
|
|
||||||
glibtop_get_sysdeps (&sysdeps);
|
glibtop_get_sysdeps (&sysdeps);
|
||||||
|
|
||||||
#define FEATURE_CHECK(f) ((sysdeps.features & (1 << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0)
|
#define FEATURE_CHECK(f) ((sysdeps.features & (1L << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0)
|
||||||
|
|
||||||
printf ("Sysdeps (0x%08lx):\n\n"
|
printf ("Sysdeps (0x%08lx):\n\n"
|
||||||
"\tfeatures:\t\t0x%08lx\n\n"
|
"\tfeatures:\t\t0x%08lx\n\n"
|
||||||
|
@@ -129,7 +129,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
|||||||
resp->u.sysdeps.features = glibtop_server_features;
|
resp->u.sysdeps.features = glibtop_server_features;
|
||||||
resp->u.sysdeps.pointer_size = sizeof (void*)*8;
|
resp->u.sysdeps.pointer_size = sizeof (void*)*8;
|
||||||
resp->u.sysdeps.flags = glibtop_server_features |
|
resp->u.sysdeps.flags = glibtop_server_features |
|
||||||
(1 << GLIBTOP_SYSDEPS_FEATURES);
|
(1L << GLIBTOP_SYSDEPS_FEATURES);
|
||||||
resp->offset = _offset_union (sysdeps);
|
resp->offset = _offset_union (sysdeps);
|
||||||
break;
|
break;
|
||||||
#if GLIBTOP_SUID_CPU
|
#if GLIBTOP_SUID_CPU
|
||||||
|
@@ -28,9 +28,9 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu =
|
static const unsigned long _glibtop_sysdeps_cpu =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
/* nlist structure for kernel access */
|
/* nlist structure for kernel access */
|
||||||
static struct nlist nlst [] = {
|
static struct nlist nlst [] = {
|
||||||
@@ -70,7 +70,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
|
|||||||
struct clockinfo ci;
|
struct clockinfo ci;
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << 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));
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf)
|
|||||||
double ldavg[3];
|
double ldavg[3];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_loadavg));
|
memset (buf, 0, sizeof (glibtop_loadavg));
|
||||||
|
|
||||||
|
@@ -32,14 +32,14 @@
|
|||||||
#include <vm/vm_param.h>
|
#include <vm/vm_param.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_mem =
|
static const unsigned long _glibtop_sysdeps_mem =
|
||||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||||
(1 << GLIBTOP_MEM_FREE) +
|
(1L << GLIBTOP_MEM_FREE) +
|
||||||
(1 << GLIBTOP_MEM_SHARED) +
|
(1L << GLIBTOP_MEM_SHARED) +
|
||||||
(1 << GLIBTOP_MEM_BUFFER) +
|
(1L << GLIBTOP_MEM_BUFFER) +
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
(1 << GLIBTOP_MEM_CACHED) +
|
(1L << GLIBTOP_MEM_CACHED) +
|
||||||
#endif
|
#endif
|
||||||
(1 << GLIBTOP_MEM_USER) + (1 << GLIBTOP_MEM_LOCKED);
|
(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
@@ -109,7 +109,7 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
|||||||
u_int v_total_count;
|
u_int v_total_count;
|
||||||
int bufspace;
|
int bufspace;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_mem));
|
memset (buf, 0, sizeof (glibtop_mem));
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ glibtop_init_msg_limits_p (glibtop *server)
|
|||||||
void
|
void
|
||||||
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_msg_limits));
|
memset (buf, 0, sizeof (glibtop_msg_limits));
|
||||||
}
|
}
|
||||||
@@ -56,9 +56,9 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
#include <sys/msg.h>
|
#include <sys/msg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||||
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNI) +
|
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNI) +
|
||||||
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGTQL) +
|
(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGTQL) +
|
||||||
(1 << GLIBTOP_IPC_MSGSSZ);
|
(1L << GLIBTOP_IPC_MSGSSZ);
|
||||||
|
|
||||||
/* The values in this structure never change at runtime, so we only
|
/* The values in this structure never change at runtime, so we only
|
||||||
* read it once during initialization. We have to use the name `_msginfo'
|
* read it once during initialization. We have to use the name `_msginfo'
|
||||||
@@ -95,7 +95,7 @@ glibtop_init_msg_limits_p (glibtop *server)
|
|||||||
void
|
void
|
||||||
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_msg_limits));
|
memset (buf, 0, sizeof (glibtop_msg_limits));
|
||||||
|
|
||||||
|
@@ -39,20 +39,20 @@
|
|||||||
#include <netinet/in_var.h>
|
#include <netinet/in_var.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload =
|
static const unsigned long _glibtop_sysdeps_netload =
|
||||||
(1 << GLIBTOP_NETLOAD_IF_FLAGS) +
|
(1L << GLIBTOP_NETLOAD_IF_FLAGS) +
|
||||||
(1 << GLIBTOP_NETLOAD_MTU) +
|
(1L << GLIBTOP_NETLOAD_MTU) +
|
||||||
(1 << GLIBTOP_NETLOAD_SUBNET) +
|
(1L << GLIBTOP_NETLOAD_SUBNET) +
|
||||||
(1 << GLIBTOP_NETLOAD_ADDRESS) +
|
(1L << GLIBTOP_NETLOAD_ADDRESS) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_IN) +
|
(1L << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT) +
|
(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_IN) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_COLLISIONS);
|
(1L << GLIBTOP_NETLOAD_COLLISIONS);
|
||||||
|
|
||||||
/* nlist structure for kernel access */
|
/* nlist structure for kernel access */
|
||||||
static struct nlist nlst [] = {
|
static struct nlist nlst [] = {
|
||||||
@@ -87,7 +87,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
|
|||||||
struct in_ifaddr in;
|
struct in_ifaddr in;
|
||||||
} ifaddr;
|
} ifaddr;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_NETLOAD), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_netload));
|
memset (buf, 0, sizeof (glibtop_netload));
|
||||||
|
|
||||||
|
@@ -51,11 +51,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_ppp =
|
static const unsigned long _glibtop_sysdeps_ppp =
|
||||||
(1 << GLIBTOP_PPP_STATE);
|
(1L << GLIBTOP_PPP_STATE);
|
||||||
|
|
||||||
#ifdef HAVE_I4B_ACCT
|
#ifdef HAVE_I4B_ACCT
|
||||||
static const unsigned long _glibtop_sysdeps_ppp_acct =
|
static const unsigned long _glibtop_sysdeps_ppp_acct =
|
||||||
(1 << GLIBTOP_PPP_BYTES_IN) + (1 << GLIBTOP_PPP_BYTES_OUT);
|
(1L << GLIBTOP_PPP_BYTES_IN) + (1L << GLIBTOP_PPP_BYTES_OUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAVE_I4B */
|
#endif /* HAVE_I4B */
|
||||||
@@ -99,7 +99,7 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
|||||||
#endif
|
#endif
|
||||||
int phase;
|
int phase;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PPP), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_ppp));
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_args =
|
static const unsigned long _glibtop_sysdeps_proc_args =
|
||||||
(1 << GLIBTOP_PROC_ARGS_SIZE);
|
(1L << GLIBTOP_PROC_ARGS_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
|
|||||||
struct stat statb;
|
struct stat statb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_ARGS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_args));
|
memset (buf, 0, sizeof (glibtop_proc_args));
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
||||||
|
|
||||||
#define BIT_SHIFT(x) (1 << (x % 32))
|
#define BIT_SHIFT(x) (1L << (x % 64))
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
||||||
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
||||||
|
@@ -49,18 +49,18 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel_pstats =
|
static const unsigned long _glibtop_sysdeps_proc_kernel_pstats =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT);
|
(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel_pcb =
|
static const unsigned long _glibtop_sysdeps_proc_kernel_pcb =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) +
|
(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP);
|
(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel_wchan =
|
static const unsigned long _glibtop_sysdeps_proc_kernel_wchan =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_NWCHAN) +
|
(1L << GLIBTOP_PROC_KERNEL_NWCHAN) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
(1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
|||||||
char filename [BUFSIZ];
|
char filename [BUFSIZ];
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
||||||
|
|
||||||
@@ -102,13 +102,13 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
|||||||
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
|
glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
|
||||||
|
|
||||||
buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE;
|
buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE;
|
||||||
buf->flags |= (1 << GLIBTOP_PROC_KERNEL_NWCHAN);
|
buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN);
|
||||||
|
|
||||||
if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) {
|
if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) {
|
||||||
strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg,
|
strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg,
|
||||||
sizeof (buf->wchan) - 1);
|
sizeof (buf->wchan) - 1);
|
||||||
buf->wchan [sizeof (buf->wchan) - 1] = 0;
|
buf->wchan [sizeof (buf->wchan) - 1] = 0;
|
||||||
buf->flags |= (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
buf->flags |= (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||||
} else {
|
} else {
|
||||||
buf->wchan [0] = 0;
|
buf->wchan [0] = 0;
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||||
|
|
||||||
/* Fetch list of currently running processes.
|
/* Fetch list of currently running processes.
|
||||||
* The interface of this function is a little bit different from the others:
|
* The interface of this function is a little bit different from the others:
|
||||||
@@ -67,7 +67,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
|
|||||||
int which, count;
|
int which, count;
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proclist));
|
memset (buf, 0, sizeof (glibtop_proclist));
|
||||||
|
|
||||||
|
@@ -49,13 +49,13 @@
|
|||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_map =
|
static const unsigned long _glibtop_sysdeps_proc_map =
|
||||||
(1 << GLIBTOP_PROC_MAP_TOTAL) + (1 << GLIBTOP_PROC_MAP_NUMBER) +
|
(1L << GLIBTOP_PROC_MAP_TOTAL) + (1L << GLIBTOP_PROC_MAP_NUMBER) +
|
||||||
(1 << GLIBTOP_PROC_MAP_SIZE);
|
(1L << GLIBTOP_PROC_MAP_SIZE);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_map_entry =
|
static const unsigned long _glibtop_sysdeps_map_entry =
|
||||||
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) +
|
(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) +
|
(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE);
|
(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
|||||||
int count, i = 0;
|
int count, i = 0;
|
||||||
int update = 0;
|
int update = 0;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << 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));
|
||||||
|
|
||||||
|
@@ -46,12 +46,12 @@
|
|||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||||
(1 << GLIBTOP_PROC_MEM_SIZE) +
|
(1L << GLIBTOP_PROC_MEM_SIZE) +
|
||||||
(1 << GLIBTOP_PROC_MEM_VSIZE) +
|
(1L << GLIBTOP_PROC_MEM_VSIZE) +
|
||||||
(1 << GLIBTOP_PROC_MEM_SHARE) +
|
(1L << GLIBTOP_PROC_MEM_SHARE) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RESIDENT) +
|
(1L << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS) +
|
(1L << GLIBTOP_PROC_MEM_RSS) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
(1L << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
@@ -98,7 +98,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
|||||||
struct plimit plimit;
|
struct plimit plimit;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_mem));
|
memset (buf, 0, sizeof (glibtop_proc_mem));
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ glibtop_get_proc_segment_p (glibtop *server,
|
|||||||
glibtop_proc_segment *buf,
|
glibtop_proc_segment *buf,
|
||||||
pid_t pid)
|
pid_t pid)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_segment));
|
memset (buf, 0, sizeof (glibtop_proc_segment));
|
||||||
|
|
||||||
|
@@ -28,10 +28,10 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ glibtop_get_proc_signal_p (glibtop *server,
|
|||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_signal));
|
memset (buf, 0, sizeof (glibtop_proc_signal));
|
||||||
|
|
||||||
|
@@ -33,8 +33,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_state =
|
static const unsigned long _glibtop_sysdeps_proc_state =
|
||||||
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_UID) +
|
(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_UID) +
|
||||||
(1 << GLIBTOP_PROC_STATE_GID);
|
(1L << GLIBTOP_PROC_STATE_GID);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ glibtop_get_proc_state_p (glibtop *server,
|
|||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_state));
|
memset (buf, 0, sizeof (glibtop_proc_state));
|
||||||
|
|
||||||
@@ -97,5 +97,5 @@ glibtop_get_proc_state_p (glibtop *server,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf->flags |= (1 << GLIBTOP_PROC_STATE_STATE);
|
buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE);
|
||||||
}
|
}
|
||||||
|
@@ -32,11 +32,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY);
|
(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time_user =
|
static const unsigned long _glibtop_sysdeps_proc_time_user =
|
||||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) +
|
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME);
|
(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME);
|
||||||
|
|
||||||
#define tv2sec(tv) (((u_int64_t) tv.tv_sec * 1000000) + (u_int64_t) tv.tv_usec)
|
#define tv2sec(tv) (((u_int64_t) tv.tv_sec * 1000000) + (u_int64_t) tv.tv_usec)
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
|
|||||||
char filename [BUFSIZ];
|
char filename [BUFSIZ];
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_time));
|
memset (buf, 0, sizeof (glibtop_proc_time));
|
||||||
|
|
||||||
|
@@ -28,11 +28,11 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||||
(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) +
|
(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) +
|
(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) +
|
||||||
(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) +
|
(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) +
|
||||||
(1 << GLIBTOP_PROC_UID_NICE);
|
(1L << GLIBTOP_PROC_UID_NICE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
|||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_uid));
|
memset (buf, 0, sizeof (glibtop_proc_uid));
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ glibtop_init_sem_limits_p (glibtop *server)
|
|||||||
void
|
void
|
||||||
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_sem_limits));
|
memset (buf, 0, sizeof (glibtop_sem_limits));
|
||||||
}
|
}
|
||||||
@@ -56,11 +56,11 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
#include <sys/sem.h>
|
#include <sys/sem.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
/* The values in this structure never change at runtime, so we only
|
/* The values in this structure never change at runtime, so we only
|
||||||
* read it once during initialization. We have to use the name `_seminfo'
|
* read it once during initialization. We have to use the name `_seminfo'
|
||||||
@@ -97,7 +97,7 @@ glibtop_init_sem_limits_p (glibtop *server)
|
|||||||
void
|
void
|
||||||
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_sem_limits));
|
memset (buf, 0, sizeof (glibtop_sem_limits));
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ 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)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_shm_limits));
|
memset (buf, 0, sizeof (glibtop_shm_limits));
|
||||||
}
|
}
|
||||||
@@ -56,9 +56,9 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
|
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
|
||||||
(1 << GLIBTOP_IPC_SHMALL);
|
(1L << GLIBTOP_IPC_SHMALL);
|
||||||
|
|
||||||
/* The values in this structure never change at runtime, so we only
|
/* The values in this structure never change at runtime, so we only
|
||||||
* read it once during initialization. We have to use the name `_shminfo'
|
* read it once during initialization. We have to use the name `_shminfo'
|
||||||
@@ -95,7 +95,7 @@ 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)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_shm_limits));
|
memset (buf, 0, sizeof (glibtop_shm_limits));
|
||||||
|
|
||||||
|
@@ -30,9 +30,9 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_swap =
|
static const unsigned long _glibtop_sysdeps_swap =
|
||||||
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
|
(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
|
||||||
(1 << GLIBTOP_SWAP_FREE) + (1 << GLIBTOP_SWAP_PAGEIN) +
|
(1L << GLIBTOP_SWAP_FREE) + (1L << GLIBTOP_SWAP_PAGEIN) +
|
||||||
(1 << GLIBTOP_SWAP_PAGEOUT);
|
(1L << GLIBTOP_SWAP_PAGEOUT);
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__FreeBSD__) || defined(__bsdi__)
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
|||||||
static int swappgsin = -1;
|
static int swappgsin = -1;
|
||||||
static int swappgsout = -1;
|
static int swappgsout = -1;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_swap));
|
memset (buf, 0, sizeof (glibtop_swap));
|
||||||
|
|
||||||
|
@@ -30,11 +30,11 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_uptime =
|
static const unsigned long _glibtop_sysdeps_uptime =
|
||||||
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME);
|
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
|
||||||
|
|
||||||
static const unsigned long _required_cpu_flags =
|
static const unsigned long _required_cpu_flags =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_IDLE) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_IDLE) +
|
||||||
(1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
|
|||||||
{
|
{
|
||||||
glibtop_cpu cpu;
|
glibtop_cpu cpu;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_uptime));
|
memset (buf, 0, sizeof (glibtop_uptime));
|
||||||
|
|
||||||
|
@@ -27,14 +27,14 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu =
|
static const unsigned long _glibtop_sysdeps_cpu =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu_smp =
|
static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||||
(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) +
|
(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
|
||||||
(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) +
|
(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) +
|
||||||
(1 << GLIBTOP_XCPU_IDLE);
|
(1L << GLIBTOP_XCPU_IDLE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,9 +27,9 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_mem =
|
static const unsigned long _glibtop_sysdeps_mem =
|
||||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||||
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) +
|
(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) +
|
||||||
(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED);
|
(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,10 +27,10 @@
|
|||||||
#include <sys/msg.h>
|
#include <sys/msg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||||
(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) +
|
(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) +
|
||||||
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) +
|
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) +
|
||||||
(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) +
|
(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) +
|
||||||
(1 << GLIBTOP_IPC_MSGTQL);
|
(1L << GLIBTOP_IPC_MSGTQL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -54,16 +54,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload =
|
static const unsigned long _glibtop_sysdeps_netload =
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_IN) +
|
(1L << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT) +
|
(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_IN) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_COLLISIONS);
|
(1L << GLIBTOP_NETLOAD_COLLISIONS);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -94,47 +94,47 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
|||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
|
||||||
flags = ifr.ifr_flags;
|
flags = ifr.ifr_flags;
|
||||||
} else
|
} else
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
if (flags & IFF_UP)
|
if (flags & IFF_UP)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
|
||||||
|
|
||||||
if (flags & IFF_BROADCAST)
|
if (flags & IFF_BROADCAST)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
|
||||||
|
|
||||||
if (flags & IFF_DEBUG)
|
if (flags & IFF_DEBUG)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
|
||||||
|
|
||||||
if (flags & IFF_LOOPBACK)
|
if (flags & IFF_LOOPBACK)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
|
||||||
|
|
||||||
if (flags & IFF_POINTOPOINT)
|
if (flags & IFF_POINTOPOINT)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
||||||
|
|
||||||
if (flags & IFF_RUNNING)
|
if (flags & IFF_RUNNING)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
|
||||||
|
|
||||||
if (flags & IFF_NOARP)
|
if (flags & IFF_NOARP)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
|
||||||
|
|
||||||
if (flags & IFF_PROMISC)
|
if (flags & IFF_PROMISC)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
|
||||||
|
|
||||||
if (flags & IFF_ALLMULTI)
|
if (flags & IFF_ALLMULTI)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
|
||||||
|
|
||||||
if (flags & IFF_MULTICAST)
|
if (flags & IFF_MULTICAST)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
|
||||||
struct sockaddr_in addr =
|
struct sockaddr_in addr =
|
||||||
*(struct sockaddr_in *) &ifr.ifr_addr;
|
*(struct sockaddr_in *) &ifr.ifr_addr;
|
||||||
buf->address = addr.sin_addr.s_addr;
|
buf->address = addr.sin_addr.s_addr;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_ADDRESS);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
@@ -142,13 +142,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
|||||||
struct sockaddr_in addr =
|
struct sockaddr_in addr =
|
||||||
*(struct sockaddr_in *) &ifr.ifr_addr;
|
*(struct sockaddr_in *) &ifr.ifr_addr;
|
||||||
buf->subnet = addr.sin_addr.s_addr;
|
buf->subnet = addr.sin_addr.s_addr;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_SUBNET);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
|
||||||
buf->mtu = ifr.ifr_mtu;
|
buf->mtu = ifr.ifr_mtu;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_MTU);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_MTU);
|
||||||
}
|
}
|
||||||
|
|
||||||
close (skfd);
|
close (skfd);
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_ppp =
|
static const unsigned long _glibtop_sysdeps_ppp =
|
||||||
(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) +
|
(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) +
|
||||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -187,13 +187,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
|||||||
if (is_ISDN_on (server, &online)) {
|
if (is_ISDN_on (server, &online)) {
|
||||||
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
|
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
|
||||||
GLIBTOP_PPP_STATE_HANGUP;
|
GLIBTOP_PPP_STATE_HANGUP;
|
||||||
buf->flags |= (1 << GLIBTOP_PPP_STATE);
|
buf->flags |= (1L << GLIBTOP_PPP_STATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_ISDN_stats (server, &in, &out)) {
|
if (get_ISDN_stats (server, &in, &out)) {
|
||||||
buf->bytes_in = in;
|
buf->bytes_in = in;
|
||||||
buf->bytes_out = out;
|
buf->bytes_out = out;
|
||||||
buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) |
|
buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) |
|
||||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_args =
|
static const unsigned long _glibtop_sysdeps_proc_args =
|
||||||
(1 << GLIBTOP_PROC_ARGS_SIZE);
|
(1L << GLIBTOP_PROC_ARGS_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,15 +27,15 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
(1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP);
|
(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel_kernel =
|
static const unsigned long _glibtop_sysdeps_proc_kernel_kernel =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_NWCHAN);
|
(1L << GLIBTOP_PROC_KERNEL_NWCHAN);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -30,8 +30,8 @@
|
|||||||
#define GLIBTOP_PROCLIST_FLAGS 3
|
#define GLIBTOP_PROCLIST_FLAGS 3
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_NUMBER) + (1 << GLIBTOP_PROCLIST_SIZE) +
|
(1L << GLIBTOP_PROCLIST_NUMBER) + (1L << GLIBTOP_PROCLIST_SIZE) +
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL);
|
(1L << GLIBTOP_PROCLIST_TOTAL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -30,14 +30,14 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_map =
|
static const unsigned long _glibtop_sysdeps_proc_map =
|
||||||
(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) +
|
(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) +
|
||||||
(1 << GLIBTOP_PROC_MAP_SIZE);
|
(1L << GLIBTOP_PROC_MAP_SIZE);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_map_entry =
|
static const unsigned long _glibtop_sysdeps_map_entry =
|
||||||
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) +
|
(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) +
|
(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) +
|
(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_FILENAME);
|
(1L << GLIBTOP_MAP_ENTRY_FILENAME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,9 +27,9 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||||
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_SIZE) +
|
(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_SIZE) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RESIDENT) + (1 << GLIBTOP_PROC_MEM_SHARE) +
|
(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_SHARE) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS) + (1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
(1L << GLIBTOP_PROC_MEM_RSS) + (1L << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
|
@@ -27,16 +27,16 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment =
|
static const unsigned long _glibtop_sysdeps_proc_segment =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_STACK_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_STACK_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment_state =
|
static const unsigned long _glibtop_sysdeps_proc_segment_state =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_STACK);
|
(1L << GLIBTOP_PROC_SEGMENT_START_STACK);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
|
@@ -27,10 +27,10 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
(1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
(1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,11 +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 =
|
||||||
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID) +
|
(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID) +
|
||||||
(1 << GLIBTOP_PROC_STATE_RUID) + (1 << GLIBTOP_PROC_STATE_RGID) +
|
(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID) +
|
||||||
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) +
|
(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) +
|
||||||
(1 << GLIBTOP_PROC_STATE_HAS_CPU) + (1 << GLIBTOP_PROC_STATE_PROCESSOR) +
|
(1L << GLIBTOP_PROC_STATE_HAS_CPU) + (1L << GLIBTOP_PROC_STATE_PROCESSOR) +
|
||||||
(1 << GLIBTOP_PROC_STATE_LAST_PROCESSOR);
|
(1L << GLIBTOP_PROC_STATE_LAST_PROCESSOR);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,12 +27,12 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME) +
|
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_CUTIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) +
|
(1L << GLIBTOP_PROC_TIME_CUTIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY);
|
(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
||||||
(1 << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1 << GLIBTOP_PROC_TIME_XCPU_STIME);
|
(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,15 +27,15 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||||
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) +
|
(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_SUID) + (1 << GLIBTOP_PROC_UID_SGID) +
|
(1L << GLIBTOP_PROC_UID_SUID) + (1L << GLIBTOP_PROC_UID_SGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_FSUID) + (1 << GLIBTOP_PROC_UID_FSGID) +
|
(1L << GLIBTOP_PROC_UID_FSUID) + (1L << GLIBTOP_PROC_UID_FSGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) +
|
(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) +
|
(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) +
|
||||||
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) +
|
(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE) +
|
(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE) +
|
||||||
(1 << GLIBTOP_PROC_UID_NGROUPS) + (1 << GLIBTOP_PROC_UID_GROUPS);
|
(1L << GLIBTOP_PROC_UID_NGROUPS) + (1L << GLIBTOP_PROC_UID_GROUPS);
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) ((a < b) ? a : b)
|
#define min(a,b) ((a < b) ? a : b)
|
||||||
|
@@ -42,11 +42,11 @@ union semun
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,9 +27,9 @@
|
|||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
|
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
|
||||||
(1 << GLIBTOP_IPC_SHMALL);
|
(1L << GLIBTOP_IPC_SHMALL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,11 +27,11 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_swap =
|
static const unsigned long _glibtop_sysdeps_swap =
|
||||||
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
|
(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
|
||||||
(1 << GLIBTOP_SWAP_FREE);
|
(1L << GLIBTOP_SWAP_FREE);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_swap_stat =
|
static const unsigned long _glibtop_sysdeps_swap_stat =
|
||||||
(1 << GLIBTOP_SWAP_PAGEIN) + (1 << GLIBTOP_SWAP_PAGEOUT);
|
(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <glibtop/sysinfo.h>
|
#include <glibtop/sysinfo.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_sysinfo =
|
static const unsigned long _glibtop_sysdeps_sysinfo =
|
||||||
(1 << GLIBTOP_SYSINFO_CPUINFO);
|
(1L << GLIBTOP_SYSINFO_CPUINFO);
|
||||||
|
|
||||||
static glibtop_sysinfo sysinfo;
|
static glibtop_sysinfo sysinfo;
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_uptime =
|
static unsigned long _glibtop_sysdeps_uptime =
|
||||||
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME) +
|
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME) +
|
||||||
(1 << GLIBTOP_UPTIME_BOOT_TIME);
|
(1L << GLIBTOP_UPTIME_BOOT_TIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,14 +26,14 @@
|
|||||||
#include <glibtop/cpu.h>
|
#include <glibtop/cpu.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu =
|
static const unsigned long _glibtop_sysdeps_cpu =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu_smp =
|
static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||||
(1 << GLIBTOP_XCPU_TOTAL) + (1 << GLIBTOP_XCPU_USER) +
|
(1L << GLIBTOP_XCPU_TOTAL) + (1L << GLIBTOP_XCPU_USER) +
|
||||||
(1 << GLIBTOP_XCPU_NICE) + (1 << GLIBTOP_XCPU_SYS) +
|
(1L << GLIBTOP_XCPU_NICE) + (1L << GLIBTOP_XCPU_SYS) +
|
||||||
(1 << GLIBTOP_XCPU_IDLE);
|
(1L << GLIBTOP_XCPU_IDLE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,12 +26,12 @@
|
|||||||
#include <glibtop/loadavg.h>
|
#include <glibtop/loadavg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg_tasks =
|
static const unsigned long _glibtop_sysdeps_loadavg_tasks =
|
||||||
(1 << GLIBTOP_LOADAVG_NR_RUNNING) +
|
(1L << GLIBTOP_LOADAVG_NR_RUNNING) +
|
||||||
(1 << GLIBTOP_LOADAVG_NR_TASKS) +
|
(1L << GLIBTOP_LOADAVG_NR_TASKS) +
|
||||||
(1 << GLIBTOP_LOADAVG_LAST_PID);
|
(1L << GLIBTOP_LOADAVG_LAST_PID);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,10 +26,10 @@
|
|||||||
#include <glibtop/mem.h>
|
#include <glibtop/mem.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_mem =
|
static const unsigned long _glibtop_sysdeps_mem =
|
||||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||||
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_SHARED) +
|
(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) +
|
||||||
(1 << GLIBTOP_MEM_BUFFER) + (1 << GLIBTOP_MEM_CACHED) +
|
(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) +
|
||||||
(1 << GLIBTOP_MEM_USER);
|
(1L << GLIBTOP_MEM_USER);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,10 +27,10 @@
|
|||||||
#include <sys/msg.h>
|
#include <sys/msg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||||
(1 << GLIBTOP_IPC_MSGPOOL) + (1 << GLIBTOP_IPC_MSGMAP) +
|
(1L << GLIBTOP_IPC_MSGPOOL) + (1L << GLIBTOP_IPC_MSGMAP) +
|
||||||
(1 << GLIBTOP_IPC_MSGMAX) + (1 << GLIBTOP_IPC_MSGMNB) +
|
(1L << GLIBTOP_IPC_MSGMAX) + (1L << GLIBTOP_IPC_MSGMNB) +
|
||||||
(1 << GLIBTOP_IPC_MSGMNI) + (1 << GLIBTOP_IPC_MSGSSZ) +
|
(1L << GLIBTOP_IPC_MSGMNI) + (1L << GLIBTOP_IPC_MSGSSZ) +
|
||||||
(1 << GLIBTOP_IPC_MSGTQL);
|
(1L << GLIBTOP_IPC_MSGTQL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -51,40 +51,40 @@
|
|||||||
#define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */
|
#define _GLIBTOP_IP_FW_ACCTOUT 0x2000 /* Account outgoing packets only. */
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload =
|
static const unsigned long _glibtop_sysdeps_netload =
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_IN) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
(1L << GLIBTOP_NETLOAD_ERRORS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_COLLISIONS);
|
(1L << GLIBTOP_NETLOAD_COLLISIONS);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_data =
|
static const unsigned long _glibtop_sysdeps_netload_data =
|
||||||
(1 << GLIBTOP_NETLOAD_ADDRESS) +
|
(1L << GLIBTOP_NETLOAD_ADDRESS) +
|
||||||
(1 << GLIBTOP_NETLOAD_SUBNET) +
|
(1L << GLIBTOP_NETLOAD_SUBNET) +
|
||||||
(1 << GLIBTOP_NETLOAD_MTU);
|
(1L << GLIBTOP_NETLOAD_MTU);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_bytes =
|
static const unsigned long _glibtop_sysdeps_netload_bytes =
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_IN) +
|
(1L << GLIBTOP_NETLOAD_BYTES_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT) +
|
(1L << GLIBTOP_NETLOAD_BYTES_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_packets =
|
static const unsigned long _glibtop_sysdeps_netload_packets =
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL);
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_total =
|
static const unsigned long _glibtop_sysdeps_netload_total =
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_in =
|
static const unsigned long _glibtop_sysdeps_netload_in =
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_IN) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_IN) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_IN);
|
(1L << GLIBTOP_NETLOAD_BYTES_IN);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_netload_out =
|
static const unsigned long _glibtop_sysdeps_netload_out =
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
(1L << GLIBTOP_NETLOAD_BYTES_TOTAL) +
|
||||||
(1 << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
(1L << GLIBTOP_NETLOAD_PACKETS_OUT) +
|
||||||
(1 << GLIBTOP_NETLOAD_BYTES_OUT);
|
(1L << GLIBTOP_NETLOAD_BYTES_OUT);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -118,47 +118,47 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
|||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) {
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_IF_FLAGS);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_IF_FLAGS);
|
||||||
flags = ifr.ifr_flags;
|
flags = ifr.ifr_flags;
|
||||||
} else
|
} else
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
if (flags & IFF_UP)
|
if (flags & IFF_UP)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_UP);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP);
|
||||||
|
|
||||||
if (flags & IFF_BROADCAST)
|
if (flags & IFF_BROADCAST)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_BROADCAST);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST);
|
||||||
|
|
||||||
if (flags & IFF_DEBUG)
|
if (flags & IFF_DEBUG)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_DEBUG);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG);
|
||||||
|
|
||||||
if (flags & IFF_LOOPBACK)
|
if (flags & IFF_LOOPBACK)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_LOOPBACK);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
|
||||||
|
|
||||||
if (flags & IFF_POINTOPOINT)
|
if (flags & IFF_POINTOPOINT)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
|
||||||
|
|
||||||
if (flags & IFF_RUNNING)
|
if (flags & IFF_RUNNING)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_RUNNING);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
|
||||||
|
|
||||||
if (flags & IFF_NOARP)
|
if (flags & IFF_NOARP)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_NOARP);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
|
||||||
|
|
||||||
if (flags & IFF_PROMISC)
|
if (flags & IFF_PROMISC)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_PROMISC);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
|
||||||
|
|
||||||
if (flags & IFF_ALLMULTI)
|
if (flags & IFF_ALLMULTI)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_ALLMULTI);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
|
||||||
|
|
||||||
if (flags & IFF_MULTICAST)
|
if (flags & IFF_MULTICAST)
|
||||||
buf->if_flags |= (1 << GLIBTOP_IF_FLAGS_MULTICAST);
|
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
|
||||||
struct sockaddr_in addr =
|
struct sockaddr_in addr =
|
||||||
*(struct sockaddr_in *) &ifr.ifr_addr;
|
*(struct sockaddr_in *) &ifr.ifr_addr;
|
||||||
buf->address = addr.sin_addr.s_addr;
|
buf->address = addr.sin_addr.s_addr;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_ADDRESS);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
@@ -166,13 +166,13 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
|||||||
struct sockaddr_in addr =
|
struct sockaddr_in addr =
|
||||||
*(struct sockaddr_in *) &ifr.ifr_addr;
|
*(struct sockaddr_in *) &ifr.ifr_addr;
|
||||||
buf->subnet = addr.sin_addr.s_addr;
|
buf->subnet = addr.sin_addr.s_addr;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_SUBNET);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_SUBNET);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy (ifr.ifr_name, interface);
|
strcpy (ifr.ifr_name, interface);
|
||||||
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
|
if (!ioctl (skfd, SIOCGIFMTU, &ifr)) {
|
||||||
buf->mtu = ifr.ifr_mtu;
|
buf->mtu = ifr.ifr_mtu;
|
||||||
buf->flags |= (1 << GLIBTOP_NETLOAD_MTU);
|
buf->flags |= (1L << GLIBTOP_NETLOAD_MTU);
|
||||||
}
|
}
|
||||||
|
|
||||||
close (skfd);
|
close (skfd);
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_ppp =
|
static const unsigned long _glibtop_sysdeps_ppp =
|
||||||
(1 << GLIBTOP_PPP_STATE) + (1 << GLIBTOP_PPP_BYTES_IN) +
|
(1L << GLIBTOP_PPP_STATE) + (1L << GLIBTOP_PPP_BYTES_IN) +
|
||||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -187,13 +187,13 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
|||||||
if (is_ISDN_on (server, &online)) {
|
if (is_ISDN_on (server, &online)) {
|
||||||
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
|
buf->state = online ? GLIBTOP_PPP_STATE_ONLINE :
|
||||||
GLIBTOP_PPP_STATE_HANGUP;
|
GLIBTOP_PPP_STATE_HANGUP;
|
||||||
buf->flags |= (1 << GLIBTOP_PPP_STATE);
|
buf->flags |= (1L << GLIBTOP_PPP_STATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_ISDN_stats (server, &in, &out)) {
|
if (get_ISDN_stats (server, &in, &out)) {
|
||||||
buf->bytes_in = in;
|
buf->bytes_in = in;
|
||||||
buf->bytes_out = out;
|
buf->bytes_out = out;
|
||||||
buf->flags |= (1 << GLIBTOP_PPP_BYTES_IN) |
|
buf->flags |= (1L << GLIBTOP_PPP_BYTES_IN) |
|
||||||
(1 << GLIBTOP_PPP_BYTES_OUT);
|
(1L << GLIBTOP_PPP_BYTES_OUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop/procargs.h>
|
#include <glibtop/procargs.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_args =
|
static const unsigned long _glibtop_sysdeps_proc_args =
|
||||||
(1 << GLIBTOP_PROC_ARGS_SIZE);
|
(1L << GLIBTOP_PROC_ARGS_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,10 +26,10 @@
|
|||||||
#include <glibtop/prockernel.h>
|
#include <glibtop/prockernel.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1 << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP) +
|
||||||
(1 << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
(1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -34,8 +34,8 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -122,28 +122,28 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
|||||||
case GLIBTOP_KERN_PROC_PGRP:
|
case GLIBTOP_KERN_PROC_PGRP:
|
||||||
/* Do you really, really need this ? */
|
/* Do you really, really need this ? */
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_PGRP))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_PGRP))
|
||||||
if ((int) arg != procuid.pgrp)
|
if ((int) arg != procuid.pgrp)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_KERN_PROC_SESSION:
|
case GLIBTOP_KERN_PROC_SESSION:
|
||||||
/* Do you really, really need this ? */
|
/* Do you really, really need this ? */
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_SESSION))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_SESSION))
|
||||||
if ((int) arg != procuid.session)
|
if ((int) arg != procuid.session)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_KERN_PROC_TTY:
|
case GLIBTOP_KERN_PROC_TTY:
|
||||||
/* Do you really, really need this ? */
|
/* Do you really, really need this ? */
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY))
|
||||||
if ((int) arg != procuid.tty)
|
if ((int) arg != procuid.tty)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_KERN_PROC_RUID:
|
case GLIBTOP_KERN_PROC_RUID:
|
||||||
/* Do you really, really need this ? */
|
/* Do you really, really need this ? */
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_EUID))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_EUID))
|
||||||
if ((int) arg != procuid.euid)
|
if ((int) arg != procuid.euid)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
@@ -151,19 +151,19 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
|||||||
|
|
||||||
if (which & GLIBTOP_EXCLUDE_NOTTY) {
|
if (which & GLIBTOP_EXCLUDE_NOTTY) {
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_TTY))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_TTY))
|
||||||
if (procuid.tty == -1) continue;
|
if (procuid.tty == -1) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 & (1 << GLIBTOP_PROC_STATE_STATE))
|
if (procstate.flags & (1L << GLIBTOP_PROC_STATE_STATE))
|
||||||
if (procstate.state != 'R') continue;
|
if (procstate.state != 'R') continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (which & GLIBTOP_EXCLUDE_SYSTEM) {
|
if (which & GLIBTOP_EXCLUDE_SYSTEM) {
|
||||||
glibtop_get_proc_uid_s (server, &procuid, pid);
|
glibtop_get_proc_uid_s (server, &procuid, pid);
|
||||||
if (procuid.flags & (1 << GLIBTOP_PROC_UID_UID))
|
if (procuid.flags & (1L << GLIBTOP_PROC_UID_UID))
|
||||||
if (procuid.uid == 0) continue;
|
if (procuid.uid == 0) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,14 +27,14 @@
|
|||||||
#include <glibtop/procmap.h>
|
#include <glibtop/procmap.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_map =
|
static const unsigned long _glibtop_sysdeps_proc_map =
|
||||||
(1 << GLIBTOP_PROC_MAP_NUMBER) + (1 << GLIBTOP_PROC_MAP_TOTAL) +
|
(1L << GLIBTOP_PROC_MAP_NUMBER) + (1L << GLIBTOP_PROC_MAP_TOTAL) +
|
||||||
(1 << GLIBTOP_PROC_MAP_SIZE);
|
(1L << GLIBTOP_PROC_MAP_SIZE);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_map_entry =
|
static const unsigned long _glibtop_sysdeps_map_entry =
|
||||||
(1 << GLIBTOP_MAP_ENTRY_START) + (1 << GLIBTOP_MAP_ENTRY_END) +
|
(1L << GLIBTOP_MAP_ENTRY_START) + (1L << GLIBTOP_MAP_ENTRY_END) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_OFFSET) + (1 << GLIBTOP_MAP_ENTRY_PERM) +
|
(1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_INODE) + (1 << GLIBTOP_MAP_ENTRY_DEVICE) +
|
(1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE) +
|
||||||
(1 << GLIBTOP_MAP_ENTRY_FILENAME);
|
(1L << GLIBTOP_MAP_ENTRY_FILENAME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,12 +26,12 @@
|
|||||||
#include <glibtop/procmem.h>
|
#include <glibtop/procmem.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||||
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RSS) +
|
(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RSS) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
(1L << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem_statm =
|
static const unsigned long _glibtop_sysdeps_proc_mem_statm =
|
||||||
(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) +
|
(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||||
(1 << GLIBTOP_PROC_MEM_SHARE);
|
(1L << GLIBTOP_PROC_MEM_SHARE);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
|
@@ -26,16 +26,16 @@
|
|||||||
#include <glibtop/procsegment.h>
|
#include <glibtop/procsegment.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment =
|
static const unsigned long _glibtop_sysdeps_proc_segment =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_STACK);
|
(1L << GLIBTOP_PROC_SEGMENT_START_STACK);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment_statm =
|
static const unsigned long _glibtop_sysdeps_proc_segment_statm =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
||||||
/* Disabled due to bug in the Linux Kernel. */
|
/* Disabled due to bug in the Linux Kernel. */
|
||||||
/* (1 << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */
|
/* (1L << GLIBTOP_PROC_SEGMENT_SHLIB_RSS) + */
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
(1L << GLIBTOP_PROC_SEGMENT_DIRTY_SIZE);
|
||||||
|
|
||||||
#ifndef LOG1024
|
#ifndef LOG1024
|
||||||
#define LOG1024 10
|
#define LOG1024 10
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include <glibtop/procsignal.h>
|
#include <glibtop/procsignal.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,10 +28,10 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_state =
|
static const unsigned long _glibtop_sysdeps_proc_state =
|
||||||
(1 << GLIBTOP_PROC_STATE_CMD);
|
(1L << GLIBTOP_PROC_STATE_CMD);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_state_uid =
|
static const unsigned long _glibtop_sysdeps_proc_state_uid =
|
||||||
(1 << GLIBTOP_PROC_STATE_UID) + (1 << GLIBTOP_PROC_STATE_GID);
|
(1L << GLIBTOP_PROC_STATE_UID) + (1L << GLIBTOP_PROC_STATE_GID);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -112,5 +112,5 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf->flags |= (1 << GLIBTOP_PROC_STATE_STATE);
|
buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE);
|
||||||
}
|
}
|
||||||
|
@@ -26,14 +26,14 @@
|
|||||||
#include <glibtop/proctime.h>
|
#include <glibtop/proctime.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) +
|
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) +
|
(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_RTIME) + (1 << GLIBTOP_PROC_TIME_FREQUENCY) +
|
(1L << GLIBTOP_PROC_TIME_RTIME) + (1L << GLIBTOP_PROC_TIME_FREQUENCY) +
|
||||||
(1 << GLIBTOP_PROC_TIME_TIMEOUT) + (1 << GLIBTOP_PROC_TIME_IT_REAL_VALUE) +
|
(1L << GLIBTOP_PROC_TIME_TIMEOUT) + (1L << GLIBTOP_PROC_TIME_IT_REAL_VALUE) +
|
||||||
(1 << GLIBTOP_PROC_TIME_START_TIME);
|
(1L << GLIBTOP_PROC_TIME_START_TIME);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
||||||
(1 << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1 << GLIBTOP_PROC_TIME_XCPU_STIME);
|
(1L << GLIBTOP_PROC_TIME_XCPU_UTIME) + (1L << GLIBTOP_PROC_TIME_XCPU_STIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,14 +26,14 @@
|
|||||||
#include <glibtop/procuid.h>
|
#include <glibtop/procuid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||||
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID);
|
(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID);
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid_stat =
|
static const unsigned long _glibtop_sysdeps_proc_uid_stat =
|
||||||
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) +
|
(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) +
|
(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) +
|
||||||
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID) +
|
(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PRIORITY) + (1 << GLIBTOP_PROC_UID_NICE);
|
(1L << GLIBTOP_PROC_UID_PRIORITY) + (1L << GLIBTOP_PROC_UID_NICE);
|
||||||
|
|
||||||
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
||||||
|
|
||||||
|
@@ -42,11 +42,11 @@ union semun
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,9 +27,9 @@
|
|||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
|
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
|
||||||
(1 << GLIBTOP_IPC_SHMALL);
|
(1L << GLIBTOP_IPC_SHMALL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,11 +28,11 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_swap =
|
static unsigned long _glibtop_sysdeps_swap =
|
||||||
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
|
(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
|
||||||
(1 << GLIBTOP_SWAP_FREE);
|
(1L << GLIBTOP_SWAP_FREE);
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_swap_paging =
|
static unsigned long _glibtop_sysdeps_swap_paging =
|
||||||
(1 << GLIBTOP_SWAP_PAGEIN) + (1 << GLIBTOP_SWAP_PAGEOUT);
|
(1L << GLIBTOP_SWAP_PAGEIN) + (1L << GLIBTOP_SWAP_PAGEOUT);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <glibtop/sysinfo.h>
|
#include <glibtop/sysinfo.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_sysinfo =
|
static const unsigned long _glibtop_sysdeps_sysinfo =
|
||||||
(1 << GLIBTOP_SYSINFO_CPUINFO);
|
(1L << GLIBTOP_SYSINFO_CPUINFO);
|
||||||
|
|
||||||
static glibtop_sysinfo sysinfo;
|
static glibtop_sysinfo sysinfo;
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <glibtop/uptime.h>
|
#include <glibtop/uptime.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_uptime =
|
static unsigned long _glibtop_sysdeps_uptime =
|
||||||
(1 << GLIBTOP_UPTIME_UPTIME) + (1 << GLIBTOP_UPTIME_IDLETIME);
|
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,9 +26,9 @@
|
|||||||
#include <glibtop/cpu.h>
|
#include <glibtop/cpu.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu =
|
static const unsigned long _glibtop_sysdeps_cpu =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <glibtop/loadavg.h>
|
#include <glibtop/loadavg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -32,8 +32,8 @@
|
|||||||
#include <mach/vm_statistics.h>
|
#include <mach/vm_statistics.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_mem =
|
static const unsigned long _glibtop_sysdeps_mem =
|
||||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||||
(1 << GLIBTOP_MEM_FREE);
|
(1L << GLIBTOP_MEM_FREE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -26,9 +26,9 @@
|
|||||||
#include <glibtop/msg_limits.h>
|
#include <glibtop/msg_limits.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||||
(1 << GLIBTOP_IPC_MSGMAP) + (1 << GLIBTOP_IPC_MSGMAX) +
|
(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGMAX) +
|
||||||
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGMNI) +
|
(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) +
|
||||||
(1 << GLIBTOP_IPC_MSGTQL);
|
(1L << GLIBTOP_IPC_MSGTQL);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_MSGMAX);
|
buf->flags += (1L << GLIBTOP_IPC_MSGMAX);
|
||||||
|
|
||||||
buf->msgmax = value;
|
buf->msgmax = value;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_MSGMNB);
|
buf->flags += (1L << GLIBTOP_IPC_MSGMNB);
|
||||||
|
|
||||||
buf->msgmnb = value;
|
buf->msgmnb = value;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_MSGMNI);
|
buf->flags += (1L << GLIBTOP_IPC_MSGMNI);
|
||||||
|
|
||||||
buf->msgmni = value;
|
buf->msgmni = value;
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_MSGTQL);
|
buf->flags += (1L << GLIBTOP_IPC_MSGTQL);
|
||||||
|
|
||||||
buf->msgtql = value;
|
buf->msgtql = value;
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
#define BIT_SHIFT(x) (1 << (x % 32))
|
#define BIT_SHIFT(x) (1L << (x % 64))
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
||||||
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
||||||
|
@@ -29,8 +29,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -36,8 +36,8 @@
|
|||||||
#include <mach/task_info.h>
|
#include <mach/task_info.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||||
(1 << GLIBTOP_PROC_MEM_VSIZE) + (1 << GLIBTOP_PROC_MEM_RESIDENT) +
|
(1L << GLIBTOP_PROC_MEM_VSIZE) + (1L << GLIBTOP_PROC_MEM_RESIDENT) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS);
|
(1L << GLIBTOP_PROC_MEM_RSS);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -98,6 +98,6 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
|||||||
|
|
||||||
buf->share = u.u_ru.ru_ixrss;
|
buf->share = u.u_ru.ru_ixrss;
|
||||||
|
|
||||||
buf->flags |= (1 << GLIBTOP_PROC_MEM_RSS_RLIM) |
|
buf->flags |= (1L << GLIBTOP_PROC_MEM_RSS_RLIM) |
|
||||||
(1 << GLIBTOP_PROC_MEM_SHARE);
|
(1L << GLIBTOP_PROC_MEM_SHARE);
|
||||||
}
|
}
|
||||||
|
@@ -29,11 +29,11 @@
|
|||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment =
|
static const unsigned long _glibtop_sysdeps_proc_segment =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_START_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
(1L << GLIBTOP_PROC_SEGMENT_END_CODE) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_START_STACK);
|
(1L << GLIBTOP_PROC_SEGMENT_START_STACK);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_state =
|
static const unsigned long _glibtop_sysdeps_proc_state =
|
||||||
(1 << GLIBTOP_PROC_STATE_CMD) + (1 << GLIBTOP_PROC_STATE_STATE) +
|
(1L << GLIBTOP_PROC_STATE_CMD) + (1L << GLIBTOP_PROC_STATE_STATE) +
|
||||||
(1 << GLIBTOP_PROC_STATE_UID);
|
(1L << GLIBTOP_PROC_STATE_UID);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -30,9 +30,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_CUTIME) +
|
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_CUTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_STIME) + (1 << GLIBTOP_PROC_TIME_CSTIME) +
|
(1L << GLIBTOP_PROC_TIME_STIME) + (1L << GLIBTOP_PROC_TIME_CSTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_START_TIME);
|
(1L << GLIBTOP_PROC_TIME_START_TIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -36,11 +36,11 @@
|
|||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||||
(1 << GLIBTOP_PROC_UID_GID) + (1 << GLIBTOP_PROC_UID_EGID) +
|
(1L << GLIBTOP_PROC_UID_GID) + (1L << GLIBTOP_PROC_UID_EGID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PID) + (1 << GLIBTOP_PROC_UID_PPID) +
|
(1L << GLIBTOP_PROC_UID_PID) + (1L << GLIBTOP_PROC_UID_PPID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PGRP) + (1 << GLIBTOP_PROC_UID_SESSION) +
|
(1L << GLIBTOP_PROC_UID_PGRP) + (1L << GLIBTOP_PROC_UID_SESSION) +
|
||||||
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID);
|
(1L << GLIBTOP_PROC_UID_TTY) + (1L << GLIBTOP_PROC_UID_TPGID);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
|||||||
|
|
||||||
buf->priority = taskinfo.base_priority;
|
buf->priority = taskinfo.base_priority;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_PROC_UID_PRIORITY);
|
buf->flags += (1L << GLIBTOP_PROC_UID_PRIORITY);
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
@@ -128,5 +128,5 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
|||||||
|
|
||||||
buf->nice = ret;
|
buf->nice = ret;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_PROC_UID_NICE);
|
buf->flags += (1L << GLIBTOP_PROC_UID_NICE);
|
||||||
}
|
}
|
||||||
|
@@ -26,9 +26,9 @@
|
|||||||
#include <glibtop/sem_limits.h>
|
#include <glibtop/sem_limits.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||||
(1 << GLIBTOP_IPC_SEMMNI) + (1 << GLIBTOP_IPC_SEMMSL) +
|
(1L << GLIBTOP_IPC_SEMMNI) + (1L << GLIBTOP_IPC_SEMMSL) +
|
||||||
(1 << GLIBTOP_IPC_SEMOPM) + (1 << GLIBTOP_IPC_SEMVMX) +
|
(1L << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMVMX) +
|
||||||
(1 << GLIBTOP_IPC_SEMAEM);
|
(1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMMNI);
|
buf->flags += (1L << GLIBTOP_IPC_SEMMNI);
|
||||||
|
|
||||||
buf->semmni = value;
|
buf->semmni = value;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMMSL);
|
buf->flags += (1L << GLIBTOP_IPC_SEMMSL);
|
||||||
|
|
||||||
buf->semmsl = value;
|
buf->semmsl = value;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMOPM);
|
buf->flags += (1L << GLIBTOP_IPC_SEMOPM);
|
||||||
|
|
||||||
buf->semopm = value;
|
buf->semopm = value;
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMUME);
|
buf->flags += (1L << GLIBTOP_IPC_SEMUME);
|
||||||
|
|
||||||
buf->semume = value;
|
buf->semume = value;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMVMX);
|
buf->flags += (1L << GLIBTOP_IPC_SEMVMX);
|
||||||
|
|
||||||
buf->semvmx = value;
|
buf->semvmx = value;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SEMAEM);
|
buf->flags += (1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
buf->semaem = value;
|
buf->semaem = value;
|
||||||
}
|
}
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include <glibtop/shm_limits.h>
|
#include <glibtop/shm_limits.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG);
|
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SHMMAX);
|
buf->flags += (1L << GLIBTOP_IPC_SHMMAX);
|
||||||
|
|
||||||
buf->shmmax = value;
|
buf->shmmax = value;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SHMMIN);
|
buf->flags += (1L << GLIBTOP_IPC_SHMMIN);
|
||||||
|
|
||||||
buf->shmmin = value;
|
buf->shmmin = value;
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SHMMNI);
|
buf->flags += (1L << GLIBTOP_IPC_SHMMNI);
|
||||||
|
|
||||||
buf->shmmni = value;
|
buf->shmmni = value;
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
|
|
||||||
if (ret != 1) return;
|
if (ret != 1) return;
|
||||||
|
|
||||||
buf->flags += (1 << GLIBTOP_IPC_SHMSEG);
|
buf->flags += (1L << GLIBTOP_IPC_SHMSEG);
|
||||||
|
|
||||||
buf->shmseg = value;
|
buf->shmseg = value;
|
||||||
}
|
}
|
||||||
|
@@ -26,8 +26,8 @@
|
|||||||
#include <glibtop/swap.h>
|
#include <glibtop/swap.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_swap =
|
static unsigned long _glibtop_sysdeps_swap =
|
||||||
(1 << GLIBTOP_SWAP_TOTAL) + (1 << GLIBTOP_SWAP_USED) +
|
(1L << GLIBTOP_SWAP_TOTAL) + (1L << GLIBTOP_SWAP_USED) +
|
||||||
(1 << GLIBTOP_SWAP_FREE);
|
(1L << GLIBTOP_SWAP_FREE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_uptime =
|
static unsigned long _glibtop_sysdeps_uptime =
|
||||||
(1 << GLIBTOP_UPTIME_UPTIME);
|
(1L << GLIBTOP_UPTIME_UPTIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -33,8 +33,8 @@
|
|||||||
#define GLIBTOP_PROCLIST_FLAGS 3
|
#define GLIBTOP_PROCLIST_FLAGS 3
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_private.h>
|
#include <glibtop_private.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_RTIME) +
|
(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_RTIME) +
|
||||||
(1 << GLIBTOP_PROC_TIME_UTIME) + (1 << GLIBTOP_PROC_TIME_STIME);
|
(1L << GLIBTOP_PROC_TIME_UTIME) + (1L << GLIBTOP_PROC_TIME_STIME);
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
||||||
|
|
||||||
#define BIT_SHIFT(x) (1 << (x % 32))
|
#define BIT_SHIFT(x) (1L << (x % 32))
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
static const unsigned long _glibtop_sysdeps_procdata_0 =
|
||||||
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
BIT_SHIFT(GLIBTOP_PROCDATA_CMD) +
|
||||||
|
@@ -27,9 +27,9 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_cpu =
|
static const unsigned long _glibtop_sysdeps_cpu =
|
||||||
(1 << GLIBTOP_CPU_TOTAL) + (1 << GLIBTOP_CPU_USER) +
|
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
|
||||||
(1 << GLIBTOP_CPU_NICE) + (1 << GLIBTOP_CPU_SYS) +
|
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
|
||||||
(1 << GLIBTOP_CPU_IDLE) + (1 << GLIBTOP_CPU_FREQUENCY);
|
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
|
||||||
|
|
||||||
/* Provides information about cpu usage. */
|
/* Provides information about cpu usage. */
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
|
|||||||
long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES];
|
long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << 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));
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_loadavg =
|
static const unsigned long _glibtop_sysdeps_loadavg =
|
||||||
(1 << GLIBTOP_LOADAVG_LOADAVG);
|
(1L << GLIBTOP_LOADAVG_LOADAVG);
|
||||||
|
|
||||||
/* Provides load averange. */
|
/* Provides load averange. */
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf)
|
|||||||
load_avg avenrun [3];
|
load_avg avenrun [3];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_LOADAVG), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_loadavg));
|
memset (buf, 0, sizeof (glibtop_loadavg));
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_mem =
|
static const unsigned long _glibtop_sysdeps_mem =
|
||||||
(1 << GLIBTOP_MEM_TOTAL) + (1 << GLIBTOP_MEM_USED) +
|
(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) +
|
||||||
(1 << GLIBTOP_MEM_FREE) + (1 << GLIBTOP_MEM_LOCKED);
|
(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_LOCKED);
|
||||||
|
|
||||||
/* define pagetok in terms of pageshift */
|
/* define pagetok in terms of pageshift */
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_mem =
|
|||||||
void
|
void
|
||||||
glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_mem));
|
memset (buf, 0, sizeof (glibtop_mem));
|
||||||
|
|
||||||
|
@@ -34,9 +34,9 @@
|
|||||||
#include <sys/msg.h>
|
#include <sys/msg.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_msg_limits =
|
static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||||
(1 << GLIBTOP_IPC_MSGMAP) + (1 << GLIBTOP_IPC_MSGMAX) +
|
(1L << GLIBTOP_IPC_MSGMAP) + (1L << GLIBTOP_IPC_MSGMAX) +
|
||||||
(1 << GLIBTOP_IPC_MSGMNB) + (1 << GLIBTOP_IPC_MSGMNI) +
|
(1L << GLIBTOP_IPC_MSGMNB) + (1L << GLIBTOP_IPC_MSGMNI) +
|
||||||
(1 << GLIBTOP_IPC_MSGSSZ) + (1 << GLIBTOP_IPC_MSGTQL);
|
(1L << GLIBTOP_IPC_MSGSSZ) + (1L << GLIBTOP_IPC_MSGTQL);
|
||||||
|
|
||||||
/* Provides information about sysv ipc limits. */
|
/* Provides information about sysv ipc limits. */
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
{
|
{
|
||||||
struct msginfo msginfo;
|
struct msginfo msginfo;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_msg_limits));
|
memset (buf, 0, sizeof (glibtop_msg_limits));
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
static const unsigned long _glibtop_sysdeps_proc_kernel =
|
||||||
(1 << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1 << GLIBTOP_PROC_KERNEL_WCHAN);
|
(1L << GLIBTOP_PROC_KERNEL_K_FLAGS) + (1L << GLIBTOP_PROC_KERNEL_WCHAN);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
||||||
|
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proclist =
|
static const unsigned long _glibtop_sysdeps_proclist =
|
||||||
(1 << GLIBTOP_PROCLIST_TOTAL) + (1 << GLIBTOP_PROCLIST_NUMBER) +
|
(1L << GLIBTOP_PROCLIST_TOTAL) + (1L << GLIBTOP_PROCLIST_NUMBER) +
|
||||||
(1 << GLIBTOP_PROCLIST_SIZE);
|
(1L << GLIBTOP_PROCLIST_SIZE);
|
||||||
|
|
||||||
/* Fetch list of currently running processes.
|
/* Fetch list of currently running processes.
|
||||||
*
|
*
|
||||||
@@ -47,7 +47,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
|
|||||||
unsigned *proc_list = NULL;
|
unsigned *proc_list = NULL;
|
||||||
size_t proc_size;
|
size_t proc_size;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proclist));
|
memset (buf, 0, sizeof (glibtop_proclist));
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_mem =
|
static const unsigned long _glibtop_sysdeps_proc_mem =
|
||||||
(1 << GLIBTOP_PROC_MEM_SIZE) + (1 << GLIBTOP_PROC_MEM_RSS) +
|
(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_RSS) +
|
||||||
(1 << GLIBTOP_PROC_MEM_RSS_RLIM);
|
(1L << GLIBTOP_PROC_MEM_RSS_RLIM);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_mem));
|
memset (buf, 0, sizeof (glibtop_proc_mem));
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_segment =
|
static const unsigned long _glibtop_sysdeps_proc_segment =
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
(1L << GLIBTOP_PROC_SEGMENT_TEXT_RSS) +
|
||||||
(1 << GLIBTOP_PROC_SEGMENT_DATA_RSS);
|
(1L << GLIBTOP_PROC_SEGMENT_DATA_RSS);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_segment));
|
memset (buf, 0, sizeof (glibtop_proc_segment));
|
||||||
|
|
||||||
|
@@ -27,8 +27,8 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1 << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED) +
|
||||||
(1 << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1 << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
(1L << GLIBTOP_PROC_SIGNAL_SIGIGNORE) + (1L << GLIBTOP_PROC_SIGNAL_SIGCATCH);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_signal));
|
memset (buf, 0, sizeof (glibtop_proc_signal));
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_state =
|
static const unsigned long _glibtop_sysdeps_proc_state =
|
||||||
(1 << GLIBTOP_PROC_STATE_STATE) + (1 << GLIBTOP_PROC_STATE_UID);
|
(1L << GLIBTOP_PROC_STATE_STATE) + (1L << GLIBTOP_PROC_STATE_UID);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_state));
|
memset (buf, 0, sizeof (glibtop_proc_state));
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_time =
|
static const unsigned long _glibtop_sysdeps_proc_time =
|
||||||
(1 << GLIBTOP_PROC_TIME_START_TIME) + (1 << GLIBTOP_PROC_TIME_UTIME);
|
(1L << GLIBTOP_PROC_TIME_START_TIME) + (1L << GLIBTOP_PROC_TIME_UTIME);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_time));
|
memset (buf, 0, sizeof (glibtop_proc_time));
|
||||||
|
|
||||||
|
@@ -27,11 +27,11 @@
|
|||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_proc_uid =
|
static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||||
(1 << GLIBTOP_PROC_UID_UID) + (1 << GLIBTOP_PROC_UID_EUID) +
|
(1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
|
||||||
(1 << GLIBTOP_PROC_UID_EGID) + (1 << GLIBTOP_PROC_UID_PID) +
|
(1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) +
|
||||||
(1 << GLIBTOP_PROC_UID_PPID) + (1 << GLIBTOP_PROC_UID_PGRP) +
|
(1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) +
|
||||||
(1 << GLIBTOP_PROC_UID_TPGID) + (1 << GLIBTOP_PROC_UID_PRIORITY) +
|
(1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) +
|
||||||
(1 << GLIBTOP_PROC_UID_NICE);
|
(1L << GLIBTOP_PROC_UID_NICE);
|
||||||
|
|
||||||
/* Provides detailed information about a process. */
|
/* Provides detailed information about a process. */
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
|||||||
{
|
{
|
||||||
struct proc *pp;
|
struct proc *pp;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_uid));
|
memset (buf, 0, sizeof (glibtop_proc_uid));
|
||||||
|
|
||||||
|
@@ -34,11 +34,11 @@
|
|||||||
#include <sys/sem.h>
|
#include <sys/sem.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_sem_limits =
|
static unsigned long _glibtop_sysdeps_sem_limits =
|
||||||
(1 << GLIBTOP_IPC_SEMMAP) + (1 << GLIBTOP_IPC_SEMMNI) +
|
(1L << GLIBTOP_IPC_SEMMAP) + (1L << GLIBTOP_IPC_SEMMNI) +
|
||||||
(1 << GLIBTOP_IPC_SEMMNS) + (1 << GLIBTOP_IPC_SEMMNU) +
|
(1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) +
|
||||||
(1 << GLIBTOP_IPC_SEMMSL) + (1 << GLIBTOP_IPC_SEMOPM) +
|
(1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) +
|
||||||
(1 << GLIBTOP_IPC_SEMUME) + (1 << GLIBTOP_IPC_SEMUSZ) +
|
(1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) +
|
||||||
(1 << GLIBTOP_IPC_SEMVMX) + (1 << GLIBTOP_IPC_SEMAEM);
|
(1L << GLIBTOP_IPC_SEMVMX) + (1L << GLIBTOP_IPC_SEMAEM);
|
||||||
|
|
||||||
/* Provides information about sysv sem limits. */
|
/* Provides information about sysv sem limits. */
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
{
|
{
|
||||||
struct seminfo seminfo;
|
struct seminfo seminfo;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_sem_limits));
|
memset (buf, 0, sizeof (glibtop_sem_limits));
|
||||||
|
|
||||||
|
@@ -34,9 +34,9 @@
|
|||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
static unsigned long _glibtop_sysdeps_shm_limits =
|
static unsigned long _glibtop_sysdeps_shm_limits =
|
||||||
(1 << GLIBTOP_IPC_SHMMAX) + (1 << GLIBTOP_IPC_SHMMIN) +
|
(1L << GLIBTOP_IPC_SHMMAX) + (1L << GLIBTOP_IPC_SHMMIN) +
|
||||||
(1 << GLIBTOP_IPC_SHMMNI) + (1 << GLIBTOP_IPC_SHMSEG) +
|
(1L << GLIBTOP_IPC_SHMMNI) + (1L << GLIBTOP_IPC_SHMSEG) +
|
||||||
(1 << GLIBTOP_IPC_SHMALL);
|
(1L << GLIBTOP_IPC_SHMALL);
|
||||||
|
|
||||||
/* Provides information about sysv ipc limits. */
|
/* Provides information about sysv ipc limits. */
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
{
|
{
|
||||||
struct shminfo shminfo;
|
struct shminfo shminfo;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_shm_limits));
|
memset (buf, 0, sizeof (glibtop_shm_limits));
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
void
|
void
|
||||||
glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||||
{
|
{
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0);
|
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_swap));
|
memset (buf, 0, sizeof (glibtop_swap));
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user