svn commit: r218429 - stable/8/sys/cddl/compat/opensolaris/sys
Martin Matuska
mm at FreeBSD.org
Tue Feb 8 08:44:09 UTC 2011
Author: mm
Date: Tue Feb 8 08:44:08 2011
New Revision: 218429
URL: http://svn.freebsd.org/changeset/base/218429
Log:
MFC r218180 (= fixed r218169):
For the ZFS kernel module, change the type of clock_t to int64_t.
The clock_t type in OpenSolaris is long (int64_t on amd64).
On FreeBSD clock_t is int32_t. The clock_t type is used in several places
in the ZFS code to store system uptime in milliseconds ("seconds * hz").
With hz=1000 we have a 32-bit integer overflow in 24 days, 20 hours,
31 minutes and 23.648 seconds. This has a user reported negative impact
on l2arc_feed_thread() and may cause unexpected results from other functions
using clock_t.
Reported by: Artem Belevich <fbsdlist at src.cx> on freebsd-fs@
Modified:
stable/8/sys/cddl/compat/opensolaris/sys/types.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/cddl/compat/opensolaris/sys/types.h
==============================================================================
--- stable/8/sys/cddl/compat/opensolaris/sys/types.h Tue Feb 8 04:48:53 2011 (r218428)
+++ stable/8/sys/cddl/compat/opensolaris/sys/types.h Tue Feb 8 08:44:08 2011 (r218429)
@@ -34,6 +34,12 @@
*/
#include <sys/stdint.h>
+
+#ifdef _KERNEL
+typedef int64_t clock_t;
+#define _CLOCK_T_DECLARED
+#endif
+
#include_next <sys/types.h>
#define MAXNAMELEN 256
More information about the svn-src-stable-8
mailing list