summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2004-05-25 14:42:51 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2004-05-25 14:42:51 +0000
commit1faa40ce18becb4f953ba5295a04af13bb65c280 (patch)
tree076d31722e313669afc96d9d8c7273899d6d1ec4
parent4e4a2bcbedeeede1c10cab6d601bfdceb81f0ec1 (diff)
downloadlibgtop-1faa40ce18becb4f953ba5295a04af13bb65c280.tar.gz
Added boot_time.
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
-rw-r--r--sysdeps/aix/ChangeLog4
-rw-r--r--sysdeps/aix/uptime.c3
-rw-r--r--sysdeps/sun4/ChangeLog4
-rw-r--r--sysdeps/sun4/uptime.c1
4 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/aix/ChangeLog b/sysdeps/aix/ChangeLog
index 2f0aa9de..8adbc08c 100644
--- a/sysdeps/aix/ChangeLog
+++ b/sysdeps/aix/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-25 Benoît Dejean <tazforever@dlfp.org>
+
+ * uptime.c: (glibtop_get_uptime_p): Added boot_time.
+
2004-03-09 Bastien Nocera <hadess@hadess.net>
* procargs.c: (glibtop_get_proc_args_s): fix g_malloc usage on non-Linux
diff --git a/sysdeps/aix/uptime.c b/sysdeps/aix/uptime.c
index 250a72d1..616d7283 100644
--- a/sysdeps/aix/uptime.c
+++ b/sysdeps/aix/uptime.c
@@ -29,6 +29,8 @@
#include <glibtop_suid.h>
+#include <time.h>
+
static const unsigned long _glibtop_sysdeps_uptime =
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
@@ -68,6 +70,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
buf->uptime = (double) cpu.total / (double) cpu.frequency;
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
+ buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;
}
diff --git a/sysdeps/sun4/ChangeLog b/sysdeps/sun4/ChangeLog
index 670cc6a0..05473cdb 100644
--- a/sysdeps/sun4/ChangeLog
+++ b/sysdeps/sun4/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-25 Benoît Dejean <tazforever@dlfp.org>
+
+ * uptime.c: (glibtop_get_uptime_p): Added boot_time.
+
2004-03-09 Bastien Nocera <hadess@hadess.net>
* open.c: (glibtop_open_p):
diff --git a/sysdeps/sun4/uptime.c b/sysdeps/sun4/uptime.c
index 023cf3f3..149ad54f 100644
--- a/sysdeps/sun4/uptime.c
+++ b/sysdeps/sun4/uptime.c
@@ -56,6 +56,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
buf->uptime = (double) cpu.total / (double) cpu.frequency;
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
+ buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;
}