Updated. Lots of cleanup.

* cpu.c: (glibtop_init_cpu_s), (glibtop_get_cpu_s):
        * loadavg.c: (glibtop_get_loadavg_s):
        * mem.c: (glibtop_init_mem_s), (glibtop_get_mem_s):
        * open.c: (glibtop_get_kstats), (glibtop_open_s):
        * procargs.c: (glibtop_get_proc_args_s):
        * procdata.c: (glibtop_get_proc_data_psinfo_s),
        (glibtop_get_proc_data_usage_s), (glibtop_get_proc_credentials_s),
        (glibtop_get_proc_status_s):
        * proclist.c: (glibtop_get_proclist_s):
        * procmap.c: (glibtop_get_proc_map_s):
        * procmem.c: (glibtop_get_proc_mem_s):
        * procstate.c: (glibtop_get_proc_state_s):
        * safeio.c:
        * safeio.h:
        * shm_limits.c: (glibtop_init_shm_limits_p),
        (glibtop_get_shm_limits_p):
        * swap.c: (glibtop_get_swap_s):
        * uptime.c: (glibtop_get_uptime_s): Updated. Lots of cleanup.
This commit is contained in:
Benoît Dejean
2004-10-11 18:01:25 +00:00
parent 13025c6c5f
commit b3dfc1d1d2
16 changed files with 292 additions and 244 deletions

View File

@@ -27,10 +27,8 @@
#include <time.h>
static const unsigned long _glibtop_sysdeps_uptime =
#if LIBGTOP_VERSION_CODE >= 1001002
(1L <<GLIBTOP_UPTIME_BOOT_TIME) +
#endif
(1L << GLIBTOP_UPTIME_UPTIME);
(1L <<GLIBTOP_UPTIME_BOOT_TIME)
| (1L << GLIBTOP_UPTIME_UPTIME);
/* Init function. */
@@ -49,9 +47,8 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
if(!(server->machine.boot))
return;
#if LIBGTOP_VERSION_CODE >= 1001002
buf->boot_time = server->machine.boot;
#endif
buf->uptime = time(NULL) - server->machine.boot;
buf->flags = _glibtop_sysdeps_uptime;