summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2009-05-07 14:24:50 +0000
committerdchagin <dchagin@FreeBSD.org>2009-05-07 14:24:50 +0000
commitf096e29878f61bbc909a9bbfff1a400a8c1d25ed (patch)
treeb9ff12a72df6d571f458e1ceea87242050bb4bb3 /sys/compat
parentf8170e41fe131d129edab0370716adf666f67cea (diff)
downloadFreeBSD-src-f096e29878f61bbc909a9bbfff1a400a8c1d25ed.zip
FreeBSD-src-f096e29878f61bbc909a9bbfff1a400a8c1d25ed.tar.gz
Linux exports HZ value to user space via AT_CLKTCK auxiliary vector entry,
which is available for Glibc as sysconf(_SC_CLK_TCK). If AT_CLKTCK entry is not exported, Glibc uses 100. linux_times() shall use the value that is exported to user space. Pointyhat to: dchagin PR: kern/134251 Approved by: kib (mentor) MFC after: 2 weeks
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_misc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 01eaa24..198818e 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -659,9 +659,7 @@ struct l_times_argv {
l_clock_t tms_cstime;
};
-#define CLK_TCK 100 /* Linux uses 100 */
-
-#define CONVTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
+#define CONVTCK(r) (r.tv_sec * hz + r.tv_usec / (1000000 / hz))
int
linux_times(struct thread *td, struct linux_times_args *args)
OpenPOWER on IntegriCloud