diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-22 20:17:54 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:29:51 +0200 |
commit | b3427143ae8dc628cb3748da7618700c6bd7ac9e (patch) | |
tree | ec004ed9e346a6feb8edb3b3cb50f7eb03572851 /process.c | |
parent | f9ddb679942b6f4309d05b5462fe5cbb3d0a2beb (diff) |
Add --clk-tck to set the clock unit
* main.c (argp_parser, main): Add and parse the --clk-tck option.
* main.h: Publish opt_clk_tck.
* process.c (sc_tc): Use the user-provided clock frequency.
* rootdir.c (rootdir_gc_stat): Likewise.
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include "procfs.h" #include "procfs_dir.h" #include "process.h" +#include "main.h" /* Implementations for the process_file_desc.get_contents callback. */ @@ -39,7 +40,7 @@ static char state_char (struct proc_stat *ps) static long int sc_tv (time_value_t tv) { double usecs = ((double) tv.seconds) * 1000000 + tv.microseconds; - return usecs * sysconf(_SC_CLK_TCK) / 1000000; + return usecs * opt_clk_tck / 1000000; } static long long int jiff_tv (time_value_t tv) |