From: Ben Gras Date: Thu, 11 Dec 2008 14:43:53 +0000 (+0000) Subject: No more HZ. X-Git-Tag: v3.1.4~193 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/CHANGES?a=commitdiff_plain;h=eeba8ef01f40cebdeb69d926e8d54a855bf6ef34;p=minix.git No more HZ. --- diff --git a/servers/rs/service.c b/servers/rs/service.c index 0a173f985..a9a218283 100644 --- a/servers/rs/service.c +++ b/servers/rs/service.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -235,8 +236,16 @@ PRIVATE int parse_arguments(int argc, char **argv) req_args = argv[i+1]; } else if (strcmp(argv[i], ARG_PERIOD)==0) { + u32_t system_hz; + if(getsysinfo_up(PM_PROC_NR, + SIU_SYSTEMHZ, sizeof(system_hz), &system_hz) < 0) { + system_hz = DEFAULT_HZ; + fprintf(stderr, "WARNING: reverting to default HZ %d\n", + system_hz); + } + req_period = strtol(argv[i+1], &hz, 10); - if (strcmp(hz,"HZ")==0) req_period *= HZ; + if (strcmp(hz,"HZ")==0) req_period *= system_hz; if (req_period < 1) { print_usage(argv[ARG_NAME], "period is at least be one tick");