summaryrefslogtreecommitdiff
path: root/sysdeps/solaris
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/solaris')
-rw-r--r--sysdeps/solaris/ChangeLog9
-rw-r--r--sysdeps/solaris/proctime.c5
2 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog
index 35e5bbb7..dff4595c 100644
--- a/sysdeps/solaris/ChangeLog
+++ b/sysdeps/solaris/ChangeLog
@@ -1,5 +1,14 @@
2006-06-24 Benoît Dejean <benoit@placenet.org>
+ * proctime.c: (glibtop_get_proc_time_s):
+
+ Fixed start time.
+
+ Patch by hua.zhang@sun.com.
+ Closes #345819.
+
+2006-06-24 Benoît Dejean <benoit@placenet.org>
+
* procmap.c: (glibtop_get_proc_map_s):
Fixed writable memory.
diff --git a/sysdeps/solaris/proctime.c b/sysdeps/solaris/proctime.c
index 0e85127b..beb6daa8 100644
--- a/sysdeps/solaris/proctime.c
+++ b/sysdeps/solaris/proctime.c
@@ -46,6 +46,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
pid_t pid)
{
struct prusage prusage;
+ GTimeVal time;
memset (buf, 0, sizeof (glibtop_proc_time));
@@ -56,7 +57,9 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
if (glibtop_get_proc_data_usage_s (server, &prusage, pid))
return;
- buf->start_time = prusage.pr_create.tv_sec;
+ g_get_current_time (&time);
+ /* prusage.pr_rtime.tv_sec is the during that the process existed */
+ buf->start_time = time.tv_sec - prusage.pr_rtime.tv_sec;
buf->rtime = prusage.pr_rtime.tv_sec * 1E+6 +
prusage.pr_rtime.tv_nsec / 1E+3;