Using correct (1 << GLIBTOP_SYSDPES_*)'. Removed const' from sysctl ()

1998-08-24  Martin Baulig  <martin@home-of-linux.org>

	* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
	* cpu.c, mem.c: Removed `const' from sysctl () constants to keep
	compiler happy.

	* procmem.c:  Added missing call to `glibtop_init_p'.

	* prockernel.c: Casting `nwchan' to `unsigned long' since this
	normally has the same size than a pointer. Well, is there a
	FreeBSD for 64bit architectures ?
This commit is contained in:
Martin Baulig
1998-08-24 19:55:38 +00:00
committed by Martin Baulig
parent fb552b8e31
commit 9d0aa0fdc1
17 changed files with 36 additions and 20 deletions

View File

@@ -1,3 +1,15 @@
1998-08-24 Martin Baulig <martin@home-of-linux.org>
* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
* cpu.c, mem.c: Removed `const' from sysctl () constants to keep
compiler happy.
* procmem.c: Added missing call to `glibtop_init_p'.
* prockernel.c: Casting `nwchan' to `unsigned long' since this
normally has the same size than a pointer. Well, is there a
FreeBSD for 64bit architectures ?
1998-08-08 Martin Baulig <martin@home-of-linux.org>
* swap.c: Added swap usage based upton the source code

View File

@@ -37,8 +37,8 @@ static struct nlist nlst [] = {
};
/* MIB array for sysctl */
static const int mib_length=2;
static const int mib [] = { CTL_KERN, KERN_CLOCKRATE };
static int mib_length=2;
static int mib [] = { CTL_KERN, KERN_CLOCKRATE };
/* Init function. */
@@ -61,7 +61,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
struct clockinfo ci;
size_t length;
glibtop_init_p (server, GLIBTOP_SYSDEPS_CPU, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_CPU), 0);
memset (buf, 0, sizeof (glibtop_cpu));

View File

@@ -44,7 +44,7 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf)
double ldavg[3];
int i;
glibtop_init_p (server, GLIBTOP_SYSDEPS_LOADAVG, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_LOADAVG), 0);
memset (buf, 0, sizeof (glibtop_loadavg));

View File

@@ -53,8 +53,8 @@ static struct nlist nlst [] = {
};
/* MIB array for sysctl */
static const int mib_length=2;
static const int mib [] = { CTL_VM, VM_METER };
static int mib_length=2;
static int mib [] = { CTL_VM, VM_METER };
/* Init function. */
@@ -89,7 +89,7 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
struct vmmeter vmm;
int bufspace;
glibtop_init_p (server, GLIBTOP_SYSDEPS_MEM, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MEM), 0);
memset (buf, 0, sizeof (glibtop_mem));

View File

@@ -68,7 +68,7 @@ glibtop_init_msg_limits_p (glibtop *server)
void
glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf)
{
glibtop_init_p (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_MSG_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_msg_limits));

View File

@@ -71,7 +71,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
struct pcb pcb;
int f, count;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
memset (buf, 0, sizeof (glibtop_proc_kernel));
@@ -130,7 +130,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
glibtop_suid_leave (server);
buf->nwchan = (u_int64_t) pinfo [0].kp_proc.p_wchan &~ KERNBASE;
buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE;
if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) {
strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg,

View File

@@ -65,7 +65,7 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
int count;
int i;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROCLIST), 0);
memset (buf, 0, sizeof (glibtop_proclist));

View File

@@ -97,6 +97,10 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
struct inode inode;
int count;
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0);
memset (buf, 0, sizeof (glibtop_proc_mem));
glibtop_suid_enter (server);
/* Get the process data */

View File

@@ -49,7 +49,7 @@ glibtop_get_proc_segment_p (glibtop *server,
struct kinfo_proc *pinfo;
int *count;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
memset (buf, 0, sizeof (glibtop_proc_segment));

View File

@@ -47,7 +47,7 @@ glibtop_get_proc_signal_p (glibtop *server,
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
memset (buf, 0, sizeof (glibtop_proc_signal));

View File

@@ -49,7 +49,7 @@ glibtop_get_proc_state_p (glibtop *server,
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_STATE), 0);
memset (buf, 0, sizeof (glibtop_proc_state));

View File

@@ -109,7 +109,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
int f, count;
quad_t totusec;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0);
memset (buf, 0, sizeof (glibtop_proc_time));

View File

@@ -49,7 +49,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
struct kinfo_proc *pinfo;
int count = 0;
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_UID), 0);
memset (buf, 0, sizeof (glibtop_proc_uid));

View File

@@ -70,7 +70,7 @@ glibtop_init_sem_limits_p (glibtop *server)
void
glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf)
{
glibtop_init_p (server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SEM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_sem_limits));

View File

@@ -68,7 +68,7 @@ glibtop_init_shm_limits_p (glibtop *server)
void
glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf)
{
glibtop_init_p (server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SHM_LIMITS), 0);
memset (buf, 0, sizeof (glibtop_shm_limits));

View File

@@ -88,7 +88,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
static int swappgsin = -1;
static int swappgsout = -1;
glibtop_init_p (server, GLIBTOP_SYSDEPS_SWAP, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_SWAP), 0);
memset (buf, 0, sizeof (glibtop_swap));

View File

@@ -49,7 +49,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
{
glibtop_cpu cpu;
glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0);
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_UPTIME), 0);
memset (buf, 0, sizeof (glibtop_uptime));