summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhusudan.C.S <madhusudancs@gmail.com>2008-08-18 17:15:00 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-08-01 01:29:21 +0200
commit688a421a1aef82d2688909f106c4a70172530b81 (patch)
treea0b735cb8020e9f52840d2a500747ee66dadb7f4
parent41ad1a2b52b6479c778a908c3dacee29c47619db (diff)
2008-08-14 Madhusudan.C.S <madhusudancs@gmail.com>
* procfs.h: (jiffy_t): New typedef. * procfs_pid.h: "procfs.h" is included. (struct procfs_pid_files): Changed all the occurrences of time_t to jiffy_t. * procfs_pid_files.c: Removed "procfs.h". (adjust_jiffy_time): Changed return type from time_t to jiffy_t. Changed the type of jiffy_time variable from time_t to jiffy_t. (get_live_threads_time): Changed the type of utime and stime from time_t to jiffy_t. (get_stat_data): Changed the type of utime and stime from time_t to jiffy_t.
-rw-r--r--procfs.h2
-rw-r--r--procfs_pid.h10
-rw-r--r--procfs_pid_files.c9
3 files changed, 12 insertions, 9 deletions
diff --git a/procfs.h b/procfs.h
index 95d4ee35..fa2fb7f7 100644
--- a/procfs.h
+++ b/procfs.h
@@ -53,6 +53,8 @@
#include <hurd/ihash.h>
#include <ps.h>
+typedef unsigned long long jiffy_t;
+
/* A single entry in a directory. */
struct procfs_dir_entry
{
diff --git a/procfs_pid.h b/procfs_pid.h
index 811cca84..566c83ea 100644
--- a/procfs_pid.h
+++ b/procfs_pid.h
@@ -26,6 +26,8 @@
#ifndef __PROCFS_PID_H__
#define __PROCFS_PID_H__
+#include "procfs.h"
+
struct procfs_pid_files
{
struct procfs_cwd *procfs_cwd;
@@ -52,10 +54,10 @@ struct procfs_stat
long unsigned cminflt;
long unsigned majflt;
long unsigned cmajflt;
- time_t utime;
- time_t stime;
- time_t cutime;
- time_t cstime;
+ jiffy_t utime;
+ jiffy_t stime;
+ jiffy_t cutime;
+ jiffy_t cstime;
long priority;
long nice;
long num_threads;
diff --git a/procfs_pid_files.c b/procfs_pid_files.c
index 1012510b..55cc52c1 100644
--- a/procfs_pid_files.c
+++ b/procfs_pid_files.c
@@ -37,7 +37,6 @@
#include <mach/task_info.h>
#include <sys/resource.h>
-#include "procfs.h"
#include "procfs_pid.h"
/* Update the files named NAME within the directory named
@@ -148,9 +147,9 @@ error_t set_field_value (struct proc_stat *ps, int pstat_flag)
Microseconds into the value in jiffies. The
value of jiffy is a hack to adjust to what
procps uses. */
-time_t adjust_jiffy_time (time_value_t time_val)
+jiffy_t adjust_jiffy_time (time_value_t time_val)
{
- time_t jiffy_time = time_val.seconds * JIFFY_ADJUST;
+ jiffy_t jiffy_time = time_val.seconds * JIFFY_ADJUST;
jiffy_time += (time_val.microseconds * JIFFY_ADJUST)
/ (1000 * 1000);
@@ -178,7 +177,7 @@ error_t get_task_thread_times (task_t task,
MACH directly since this is neither made available by libps
nor by proc server. */
error_t get_live_threads_time (struct proc_stat *ps,
- time_t *utime, time_t *stime)
+ jiffy_t *utime, jiffy_t *stime)
{
struct task_thread_times_info live_threads_times;
error_t err = set_field_value (ps, PSTAT_TASK);
@@ -208,7 +207,7 @@ error_t get_stat_data (pid_t pid,
malloc (sizeof (struct procfs_stat));
struct proc_stat *ps;
- time_t utime, stime;
+ jiffy_t utime, stime;
err = _proc_stat_create (pid, ps_context, &ps);