Some applications assume centisecond precision, or at most millisecond precision
(e.g. guile). This is a work-around for them.
Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name unsubmitted-clock_t_centiseconds.diff
#include <time.h>
-/* Return frequency of `times'.
- Since Mach reports CPU times in microseconds, we always use 1 million. */
+/* Return frequency of `times'. */
int
__getclktck (void)
{
- return 1000000;
+ return 100;
}
/* Before glibc 2.2, the Hurd actually did this differently, so we
static time_t quantum = -1;
if (quantum == -1)
- quantum = 1000000 / __getclktck ();
+ quantum = 100 / __getclktck ();
tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
if (tv->tv_usec >= 1000000)
static inline clock_t
clock_from_time_value (const time_value_t *t)
{
- return t->seconds * 1000000 + t->microseconds;
+ return t->seconds * 100 + t->microseconds / 10000;
}
/* Store the CPU time used by this process and all its