Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 2009 14:24:50 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191883 - head/sys/compat/linux
Message-ID:  <200905071424.n47EOos1058369@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Thu May  7 14:24:50 2009
New Revision: 191883
URL: http://svn.freebsd.org/changeset/base/191883

Log:
  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

Modified:
  head/sys/compat/linux/linux_misc.c

Modified: head/sys/compat/linux/linux_misc.c
==============================================================================
--- head/sys/compat/linux/linux_misc.c	Thu May  7 13:49:48 2009	(r191882)
+++ head/sys/compat/linux/linux_misc.c	Thu May  7 14:24:50 2009	(r191883)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905071424.n47EOos1058369>