summaryrefslogtreecommitdiff
path: root/sysdeps/sun4
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-06-02 22:23:45 +0000
committerMartin Baulig <martin@src.gnome.org>1998-06-02 22:23:45 +0000
commit3728e4c34e119370290977bd3c4dfd96524515cb (patch)
tree6004c835d7b8eeff2de6daef7d29a647af34a48f /sysdeps/sun4
parente71eb0e75b0a3d0a6f0d76526758ba5023b213f4 (diff)
downloadlibgtop-3728e4c34e119370290977bd3c4dfd96524515cb.tar.gz
renamed all functions implementing features to '__p' (since they need to
* sysdeps/sun4/*.c: renamed all functions implementing features to '__p' (since they need to be SGID kmem on SunOS).
Diffstat (limited to 'sysdeps/sun4')
-rw-r--r--sysdeps/sun4/cpu.c14
-rw-r--r--sysdeps/sun4/init.c6
-rw-r--r--sysdeps/sun4/loadavg.c4
-rw-r--r--sysdeps/sun4/mem.c4
-rw-r--r--sysdeps/sun4/msg_limits.c4
-rw-r--r--sysdeps/sun4/open.c3
-rw-r--r--sysdeps/sun4/procdata.c2
-rw-r--r--sysdeps/sun4/prockernel.c4
-rw-r--r--sysdeps/sun4/proclist.c4
-rw-r--r--sysdeps/sun4/procmem.c4
-rw-r--r--sysdeps/sun4/procsegment.c4
-rw-r--r--sysdeps/sun4/procsignal.c6
-rw-r--r--sysdeps/sun4/procstate.c4
-rw-r--r--sysdeps/sun4/proctime.c6
-rw-r--r--sysdeps/sun4/procuid.c6
-rw-r--r--sysdeps/sun4/sem_limits.c4
-rw-r--r--sysdeps/sun4/shm_limits.c4
-rw-r--r--sysdeps/sun4/swap.c4
-rw-r--r--sysdeps/sun4/uptime.c4
19 files changed, 64 insertions, 27 deletions
diff --git a/sysdeps/sun4/cpu.c b/sysdeps/sun4/cpu.c
index e5efea4d..6ca965ae 100644
--- a/sysdeps/sun4/cpu.c
+++ b/sysdeps/sun4/cpu.c
@@ -30,11 +30,13 @@ static const unsigned long _glibtop_sysdeps_cpu =
/* Provides information about cpu usage. */
void
-glibtop_get_cpu__r (glibtop *server, glibtop_cpu *buf)
+glibtop_get_cpu__p (glibtop *server, glibtop_cpu *buf)
{
long cp_time [CPUSTATES], mp_time [NCPU][CPUSTATES];
int i;
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_cpu));
/* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */
@@ -43,15 +45,17 @@ glibtop_get_cpu__r (glibtop *server, glibtop_cpu *buf)
/* get the cp_time array */
- (void) _glibtop_getkval (server, _glibtop_nlist [X_CP_TIME].n_value, (int *) cp_time,
- sizeof (cp_time), _glibtop_nlist [X_CP_TIME].n_name);
+ (void) _glibtop_getkval (server, _glibtop_nlist [X_CP_TIME].n_value,
+ (int *) cp_time, sizeof (cp_time),
+ _glibtop_nlist [X_CP_TIME].n_name);
#ifdef MULTIPROCESSOR
/* get the mp_time array as well */
if (server->machine.ncpu > 1) {
- (void) _glibtop_getkval (server, _glibtop_nlist [X_MP_TIME].n_value, (int *) mp_time,
- sizeof (mp_time), _glibtop_nlist [X_MP_TIME].n_name);
+ (void) _glibtop_getkval (server, _glibtop_nlist [X_MP_TIME].n_value,
+ (int *) mp_time, sizeof (mp_time),
+ _glibtop_nlist [X_MP_TIME].n_name);
}
#endif
diff --git a/sysdeps/sun4/init.c b/sysdeps/sun4/init.c
index f6a9a506..e39cfd29 100644
--- a/sysdeps/sun4/init.c
+++ b/sysdeps/sun4/init.c
@@ -26,14 +26,16 @@ static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = NULL;
glibtop *
-glibtop_init__r (glibtop **server)
+glibtop_init__r (glibtop **server, const unsigned long features,
+ const unsigned flags)
{
if (*server != NULL)
return *server;
if (glibtop_global_server == NULL) {
glibtop_global_server = &_glibtop_global_server;
- glibtop_open (glibtop_global_server, "glibtop");
+ glibtop_open__r (glibtop_global_server, "glibtop",
+ features, flags);
}
return *server = glibtop_global_server;
diff --git a/sysdeps/sun4/loadavg.c b/sysdeps/sun4/loadavg.c
index de6605e0..07d4c0e9 100644
--- a/sysdeps/sun4/loadavg.c
+++ b/sysdeps/sun4/loadavg.c
@@ -25,7 +25,9 @@
/* Provides load averange. */
void
-glibtop_get_loadavg__r (glibtop *server, glibtop_loadavg *buf)
+glibtop_get_loadavg__p (glibtop *server, glibtop_loadavg *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_loadavg));
}
diff --git a/sysdeps/sun4/mem.c b/sysdeps/sun4/mem.c
index d6a67788..ab602e70 100644
--- a/sysdeps/sun4/mem.c
+++ b/sysdeps/sun4/mem.c
@@ -33,8 +33,10 @@ static const unsigned long _glibtop_sysdeps_mem =
/* Provides information about memory usage. */
void
-glibtop_get_mem__r (glibtop *server, glibtop_mem *buf)
+glibtop_get_mem__p (glibtop *server, glibtop_mem *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_mem));
/* !!! THE FOLLOWING CODE RUNS SGID KMEM - CHANGE WITH CAUTION !!! */
diff --git a/sysdeps/sun4/msg_limits.c b/sysdeps/sun4/msg_limits.c
index 62819042..eca74df9 100644
--- a/sysdeps/sun4/msg_limits.c
+++ b/sysdeps/sun4/msg_limits.c
@@ -24,7 +24,9 @@
/* Provides information about sysv ipc limits. */
void
-glibtop_get_msg_limits__r (glibtop *server, glibtop_msg_limits *buf)
+glibtop_get_msg_limits__p (glibtop *server, glibtop_msg_limits *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_msg_limits));
}
diff --git a/sysdeps/sun4/open.c b/sysdeps/sun4/open.c
index 1944cdf7..0193c00f 100644
--- a/sysdeps/sun4/open.c
+++ b/sysdeps/sun4/open.c
@@ -57,7 +57,8 @@ struct nlist _glibtop_nlist[] = {
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
void
-glibtop_open (glibtop *server, const char *program_name)
+glibtop_open__r (glibtop *server, const char *program_name,
+ const unsigned long features, const unsigned flags)
{
register int pagesize;
diff --git a/sysdeps/sun4/procdata.c b/sysdeps/sun4/procdata.c
index b542721d..fa32152e 100644
--- a/sysdeps/sun4/procdata.c
+++ b/sysdeps/sun4/procdata.c
@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
-glibtop_get_procdata__r (glibtop *server, glibtop_procdata *buf, pid_t pid)
+glibtop_get_procdata__p (glibtop *server, glibtop_procdata *buf, pid_t pid)
{
memset (buf, 0, sizeof (glibtop_procdata));
}
diff --git a/sysdeps/sun4/prockernel.c b/sysdeps/sun4/prockernel.c
index 93f47bb1..ab13bb95 100644
--- a/sysdeps/sun4/prockernel.c
+++ b/sysdeps/sun4/prockernel.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_kernel__r (glibtop *server, glibtop_proc_kernel *buf,
+glibtop_get_proc_kernel__p (glibtop *server, glibtop_proc_kernel *buf,
pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_kernel));
}
diff --git a/sysdeps/sun4/proclist.c b/sysdeps/sun4/proclist.c
index f3e0b993..66778f57 100644
--- a/sysdeps/sun4/proclist.c
+++ b/sysdeps/sun4/proclist.c
@@ -32,8 +32,10 @@
* each buf->size big. The total size is stored in buf->total. */
unsigned *
-glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
+glibtop_get_proclist__p (glibtop *server, glibtop_proclist *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proclist));
return NULL;
}
diff --git a/sysdeps/sun4/procmem.c b/sysdeps/sun4/procmem.c
index 889a4a20..1e018270 100644
--- a/sysdeps/sun4/procmem.c
+++ b/sysdeps/sun4/procmem.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_mem__r (glibtop *server, glibtop_proc_mem *buf,
+glibtop_get_proc_mem__p (glibtop *server, glibtop_proc_mem *buf,
pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_mem));
}
diff --git a/sysdeps/sun4/procsegment.c b/sysdeps/sun4/procsegment.c
index c0ffeb17..5793d386 100644
--- a/sysdeps/sun4/procsegment.c
+++ b/sysdeps/sun4/procsegment.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_segment__r (glibtop *server, glibtop_proc_segment *buf,
+glibtop_get_proc_segment__p (glibtop *server, glibtop_proc_segment *buf,
pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_segment));
}
diff --git a/sysdeps/sun4/procsignal.c b/sysdeps/sun4/procsignal.c
index 6c30ee66..a3e905ae 100644
--- a/sysdeps/sun4/procsignal.c
+++ b/sysdeps/sun4/procsignal.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_signal__r (glibtop *server, glibtop_proc_signal *buf,
- pid_t pid)
+glibtop_get_proc_signal__p (glibtop *server, glibtop_proc_signal *buf,
+ pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_signal));
}
diff --git a/sysdeps/sun4/procstate.c b/sysdeps/sun4/procstate.c
index b8ad5cec..a0ffb312 100644
--- a/sysdeps/sun4/procstate.c
+++ b/sysdeps/sun4/procstate.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_state__r (glibtop *server, glibtop_proc_state *buf,
+glibtop_get_proc_state__p (glibtop *server, glibtop_proc_state *buf,
pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_state));
}
diff --git a/sysdeps/sun4/proctime.c b/sysdeps/sun4/proctime.c
index ec81d2a0..8bd4f728 100644
--- a/sysdeps/sun4/proctime.c
+++ b/sysdeps/sun4/proctime.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_time__r (glibtop *server, glibtop_proc_time *buf,
- pid_t pid)
+glibtop_get_proc_time__p (glibtop *server, glibtop_proc_time *buf,
+ pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_time));
}
diff --git a/sysdeps/sun4/procuid.c b/sysdeps/sun4/procuid.c
index 7fbb85fa..a4c15f8f 100644
--- a/sysdeps/sun4/procuid.c
+++ b/sysdeps/sun4/procuid.c
@@ -25,8 +25,10 @@
/* Provides detailed information about a process. */
void
-glibtop_get_proc_uid__r (glibtop *server, glibtop_proc_uid *buf,
- pid_t pid)
+glibtop_get_proc_uid__p (glibtop *server, glibtop_proc_uid *buf,
+ pid_t pid)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_proc_uid));
}
diff --git a/sysdeps/sun4/sem_limits.c b/sysdeps/sun4/sem_limits.c
index 3768408b..ef4df709 100644
--- a/sysdeps/sun4/sem_limits.c
+++ b/sysdeps/sun4/sem_limits.c
@@ -24,7 +24,9 @@
/* Provides information about sysv sem limits. */
void
-glibtop_get_sem_limits__r (glibtop *server, glibtop_sem_limits *buf)
+glibtop_get_sem_limits__p (glibtop *server, glibtop_sem_limits *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_sem_limits));
}
diff --git a/sysdeps/sun4/shm_limits.c b/sysdeps/sun4/shm_limits.c
index 52e801ba..b51528b1 100644
--- a/sysdeps/sun4/shm_limits.c
+++ b/sysdeps/sun4/shm_limits.c
@@ -24,7 +24,9 @@
/* Provides information about sysv ipc limits. */
void
-glibtop_get_shm_limits__r (glibtop *server, glibtop_shm_limits *buf)
+glibtop_get_shm_limits__p (glibtop *server, glibtop_shm_limits *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_shm_limits));
}
diff --git a/sysdeps/sun4/swap.c b/sysdeps/sun4/swap.c
index 8e0d046b..c1c3f2a8 100644
--- a/sysdeps/sun4/swap.c
+++ b/sysdeps/sun4/swap.c
@@ -25,7 +25,9 @@
/* Provides information about swap usage. */
void
-glibtop_get_swap__r (glibtop *server, glibtop_swap *buf)
+glibtop_get_swap__p (glibtop *server, glibtop_swap *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_swap));
}
diff --git a/sysdeps/sun4/uptime.c b/sysdeps/sun4/uptime.c
index 5b9ea63f..58b87a8e 100644
--- a/sysdeps/sun4/uptime.c
+++ b/sysdeps/sun4/uptime.c
@@ -25,7 +25,9 @@
/* Provides uptime and idle time. */
void
-glibtop_get_uptime__r (glibtop *server, glibtop_uptime *buf)
+glibtop_get_uptime__p (glibtop *server, glibtop_uptime *buf)
{
+ glibtop_init__r (&server, 0, 0);
+
memset (buf, 0, sizeof (glibtop_uptime));
}