summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--examples/sysdeps.c2
-rw-r--r--include/glibtop/sysdeps.h50
-rw-r--r--lib/init.c2
-rw-r--r--lib/sysdeps.c1
-rw-r--r--src/daemon/slave.c1
-rw-r--r--sysdeps/names/sysdeps.c8
7 files changed, 42 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d065b48..b8ba73bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-05-06 Martin Baulig <martin@home-of-linux.org>
+
+ * include/glibtop/sysdeps.h (glibtop_sysdeps): Added `pointer_size'
+ which is the number of bits of a `void *'.
+
1999-05-03 Martin Baulig <martin@home-of-linux.org>
Set version number to 1.1.0. Also made a `LIBGTOP_STABLE_1_0'
diff --git a/examples/sysdeps.c b/examples/sysdeps.c
index 62f87ff5..d323135d 100644
--- a/examples/sysdeps.c
+++ b/examples/sysdeps.c
@@ -73,6 +73,7 @@ main (int argc, char *argv [])
printf ("Sysdeps (0x%08lx):\n\n"
"\tfeatures:\t\t0x%08lx\n\n"
+ "\tpointer_size:\t\t0x%08lx\n\n"
"\tcpu:\t\t%d\t0x%08lx\n"
"\tmem:\t\t%d\t0x%08lx\n"
"\tswap:\t\t%d\t0x%08lx\n\n"
@@ -97,6 +98,7 @@ main (int argc, char *argv [])
"\tppp:\t\t%d\t0x%08lx\n\n",
(unsigned long) sysdeps.flags,
(unsigned long) sysdeps.features,
+ (unsigned long) sysdeps.pointer_size,
FEATURE_CHECK(CPU),
(unsigned long) sysdeps.cpu,
FEATURE_CHECK(MEM),
diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h
index b81d9f3f..b3222aba 100644
--- a/include/glibtop/sysdeps.h
+++ b/include/glibtop/sysdeps.h
@@ -31,30 +31,31 @@
BEGIN_LIBGTOP_DECLS
#define GLIBTOP_SYSDEPS_FEATURES 0
-#define GLIBTOP_SYSDEPS_CPU 1
-#define GLIBTOP_SYSDEPS_MEM 2
-#define GLIBTOP_SYSDEPS_SWAP 3
-#define GLIBTOP_SYSDEPS_UPTIME 4
-#define GLIBTOP_SYSDEPS_LOADAVG 5
-#define GLIBTOP_SYSDEPS_SHM_LIMITS 6
-#define GLIBTOP_SYSDEPS_MSG_LIMITS 7
-#define GLIBTOP_SYSDEPS_SEM_LIMITS 8
-#define GLIBTOP_SYSDEPS_PROCLIST 9
-#define GLIBTOP_SYSDEPS_PROC_STATE 10
-#define GLIBTOP_SYSDEPS_PROC_UID 11
-#define GLIBTOP_SYSDEPS_PROC_MEM 12
-#define GLIBTOP_SYSDEPS_PROC_TIME 13
-#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14
-#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
-#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
-#define GLIBTOP_SYSDEPS_PROC_ARGS 17
-#define GLIBTOP_SYSDEPS_PROC_MAP 18
-#define GLIBTOP_SYSDEPS_MOUNTLIST 19
-#define GLIBTOP_SYSDEPS_FSUSAGE 20
-#define GLIBTOP_SYSDEPS_NETLOAD 21
-#define GLIBTOP_SYSDEPS_PPP 22
-
-#define GLIBTOP_MAX_SYSDEPS 23
+#define GLIBTOP_SYSDEPS_POINTER_SIZE 1
+#define GLIBTOP_SYSDEPS_CPU 2
+#define GLIBTOP_SYSDEPS_MEM 3
+#define GLIBTOP_SYSDEPS_SWAP 4
+#define GLIBTOP_SYSDEPS_UPTIME 5
+#define GLIBTOP_SYSDEPS_LOADAVG 6
+#define GLIBTOP_SYSDEPS_SHM_LIMITS 7
+#define GLIBTOP_SYSDEPS_MSG_LIMITS 8
+#define GLIBTOP_SYSDEPS_SEM_LIMITS 9
+#define GLIBTOP_SYSDEPS_PROCLIST 10
+#define GLIBTOP_SYSDEPS_PROC_STATE 11
+#define GLIBTOP_SYSDEPS_PROC_UID 12
+#define GLIBTOP_SYSDEPS_PROC_MEM 13
+#define GLIBTOP_SYSDEPS_PROC_TIME 14
+#define GLIBTOP_SYSDEPS_PROC_SIGNAL 15
+#define GLIBTOP_SYSDEPS_PROC_KERNEL 16
+#define GLIBTOP_SYSDEPS_PROC_SEGMENT 17
+#define GLIBTOP_SYSDEPS_PROC_ARGS 18
+#define GLIBTOP_SYSDEPS_PROC_MAP 19
+#define GLIBTOP_SYSDEPS_MOUNTLIST 20
+#define GLIBTOP_SYSDEPS_FSUSAGE 21
+#define GLIBTOP_SYSDEPS_NETLOAD 22
+#define GLIBTOP_SYSDEPS_PPP 23
+
+#define GLIBTOP_MAX_SYSDEPS 24
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
@@ -68,6 +69,7 @@ struct _glibtop_sysdeps
{
u_int64_t flags,
features, /* server features */
+ pointer_size, /* sizeof(void*)*8 */
cpu, /* glibtop_cpu */
mem, /* glibtop_mem */
swap, /* glibtop_swap */
diff --git a/lib/init.c b/lib/init.c
index 38299612..9050598a 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -243,6 +243,8 @@ glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
for (init_fkt = _glibtop_init_hook_s; *init_fkt; init_fkt++)
(*init_fkt) (server);
+
+ server->sysdeps.pointer_size = sizeof (void*)*8;
server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS;
}
diff --git a/lib/sysdeps.c b/lib/sysdeps.c
index 88bb9854..94ab190d 100644
--- a/lib/sysdeps.c
+++ b/lib/sysdeps.c
@@ -40,6 +40,7 @@ GLIBTOP_SUID_PROC_TIME +
GLIBTOP_SUID_PROC_SIGNAL +
GLIBTOP_SUID_PROC_KERNEL +
GLIBTOP_SUID_PROC_SEGMENT +
+GLIBTOP_SUID_PROC_ARGS +
GLIBTOP_SUID_PROC_MAP +
GLIBTOP_SUID_NETLOAD +
GLIBTOP_SUID_PPP;
diff --git a/src/daemon/slave.c b/src/daemon/slave.c
index 91d97879..97eb4233 100644
--- a/src/daemon/slave.c
+++ b/src/daemon/slave.c
@@ -127,6 +127,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
memcpy (&resp->u.sysdeps, &server->sysdeps,
sizeof (glibtop_sysdeps));
resp->u.sysdeps.features = glibtop_server_features;
+ resp->u.sysdeps.pointer_size = sizeof (void*)*8;
resp->u.sysdeps.flags = glibtop_server_features |
(1 << GLIBTOP_SYSDEPS_FEATURES);
resp->offset = _offset_union (sysdeps);
diff --git a/sysdeps/names/sysdeps.c b/sysdeps/names/sysdeps.c
index 135a9d68..65209a71 100644
--- a/sysdeps/names/sysdeps.c
+++ b/sysdeps/names/sysdeps.c
@@ -27,8 +27,8 @@
const char *glibtop_names_sysdeps[GLIBTOP_MAX_SYSDEPS] =
{
- "features", "cpu", "mem", "swap", "uptime", "loadavg",
- "shm_limits", "msg_limits", "sem_limits", "proclist",
+ "features", "pointer_size", "cpu", "mem", "swap", "uptime",
+ "loadavg", "shm_limits", "msg_limits", "sem_limits", "proclist",
"proc_state", "proc_uid", "proc_mem", "proc_time",
"proc_signal", "proc_kernel", "proc_segment", "proc_args",
"proc_map", "mountlist", "fsusage", "netload", "ppp"
@@ -43,12 +43,13 @@ const unsigned glibtop_types_sysdeps[GLIBTOP_MAX_SYSDEPS] =
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
- GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
+ GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
};
const char *glibtop_labels_sysdeps[GLIBTOP_MAX_SYSDEPS] =
{
N_ ("Server Features"),
+ N_ ("Pointer Size"),
N_ ("CPU Usage"),
N_ ("Memory Usage"),
N_ ("Swap Usage"),
@@ -76,6 +77,7 @@ const char *glibtop_labels_sysdeps[GLIBTOP_MAX_SYSDEPS] =
const char *glibtop_descriptions_sysdeps[GLIBTOP_MAX_SYSDEPS] =
{
N_ ("Server Features"),
+ N_ ("Pointer Size on the Server (in bits)"),
N_ ("CPU Usage"),
N_ ("Memory Usage"),
N_ ("Swap Usage"),