Added pointer_size' which is the number of bits of a void *'.

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 *'.
This commit is contained in:
Martin Baulig
1999-05-06 19:49:31 +00:00
committed by Martin Baulig
parent fec8f23ad4
commit d67182f411
7 changed files with 41 additions and 26 deletions

View File

@@ -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'

View File

@@ -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),

View File

@@ -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_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 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 */

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);

View File

@@ -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"),