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 /rootdir.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 'rootdir.c')
-rw-r--r-- | rootdir.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -7,6 +7,7 @@ #include <ps.h> #include "procfs.h" #include "procfs_dir.h" +#include "main.h" /* This implements a directory node with the static files in /proc */ @@ -105,7 +106,7 @@ rootdir_gc_stat (void *hook, void **contents, size_t *contents_len) return EIO; timersub (&time, &boottime, &time); - up_ticks = sysconf(_SC_CLK_TCK) * (time.tv_sec + time.tv_usec / 1000000.); + up_ticks = opt_clk_tck * (time.tv_sec + time.tv_usec / 1000000.); *contents_len = asprintf ((char **) contents, /* Does Mach keeps track of any of this? */ |