Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2010 07:52:54 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r202964 - head/sys/cddl/compat/opensolaris/sys
Message-ID:  <201001250752.o0P7qsFo093957@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Jan 25 07:52:54 2010
New Revision: 202964
URL: http://svn.freebsd.org/changeset/base/202964

Log:
  On FreeBSD, time_t is 64-bit for all platforms except i386 and powerpc,
  where the type is 32-bit.  ZFS can handle 64-bit timestamp internally
  but zfs_setattr() would check if the time value can fit, we change the
  checking macros to match 64-bit timestamp if the platform supports it.
  
  This change has some downsides like, while you can import zfs on 32-bit
  platforms, the timestamp would overflow if they are out of the range.
  
  This fixes the Y2.038K issue on platforms using 64-bit timestamps.
  
  Reviewed by:	pjd
  MFC after:	1 month

Modified:
  head/sys/cddl/compat/opensolaris/sys/time.h

Modified: head/sys/cddl/compat/opensolaris/sys/time.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/time.h	Mon Jan 25 07:37:37 2010	(r202963)
+++ head/sys/cddl/compat/opensolaris/sys/time.h	Mon Jan 25 07:52:54 2010	(r202964)
@@ -40,8 +40,13 @@ typedef longlong_t	hrtime_t;
 
 #define	LBOLT	((gethrtime() * hz) / NANOSEC)
 
+#if defined(__i386__) || defined(__powerpc__)
 #define	TIMESPEC_OVERFLOW(ts)						\
 	((ts)->tv_sec < INT32_MIN || (ts)->tv_sec > INT32_MAX)
+#else
+#define	TIMESPEC_OVERFLOW(ts)						\
+	((ts)->tv_sec < INT64_MIN || (ts)->tv_sec > INT64_MAX)
+#endif
 
 #ifdef _KERNEL
 #define	lbolt64	(int64_t)(LBOLT)



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