From owner-svn-src-head@FreeBSD.ORG Tue Feb 1 19:04:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4578D1065674; Tue, 1 Feb 2011 19:04:22 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 80C928FC15; Tue, 1 Feb 2011 19:04:20 +0000 (UTC) Received: by wwf26 with SMTP id 26so7108704wwf.31 for ; Tue, 01 Feb 2011 11:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=y3p0BceBzKQU4gZAXsqtgzZF8eWPZrcnIoWettELRQo=; b=P6QT0q30azBvuO5d1u/+/qboCTCAfFSlQtefXnScou1a+30p0fdr/XuChmVNsj8MDf xtGC4Rk/a0vxli3Pq+9k//at/P5FN4D6XPR6nB/fy2HXOYvap/6As9dlkEKe1/C8zK1N ouUtRHSPwC1u+ESoTdfFaQA+HEfcHmzDjIJYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ZPlxa1oOhSWCWwShUxjJV8O2TN/wXyj4ieZmgh+pM3bsIVKZX83/688TzvZ1xRu2iD zHsGqCfi/xrP7wSxKNwNy362B1OzeNvCMJwVLX+htaXU8EOPtEfBk6BggG7+XKcYUXid J8VtHjgapJKgEdq78O5WECg93WWKfIf6+LKOM= MIME-Version: 1.0 Received: by 10.216.51.130 with SMTP id b2mr7874922wec.42.1296587059428; Tue, 01 Feb 2011 11:04:19 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.71.200 with HTTP; Tue, 1 Feb 2011 11:04:19 -0800 (PST) In-Reply-To: <201102011428.p11ESoQw074786@svn.freebsd.org> References: <201102011428.p11ESoQw074786@svn.freebsd.org> Date: Tue, 1 Feb 2011 11:04:19 -0800 X-Google-Sender-Auth: LvdYIAz-kkgeZLNVn9f1aNKSAJA Message-ID: From: Garrett Cooper To: Martin Matuska Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218169 - head/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 19:04:22 -0000 On Tue, Feb 1, 2011 at 6:28 AM, Martin Matuska wrote: > Author: mm > Date: Tue Feb 1 14:28:50 2011 > New Revision: 218169 > URL: http://svn.freebsd.org/changeset/base/218169 > > Log: > For ZFS, 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. This change broke the build. This header is also nasty because it doesn't conform to POSIX. Here's what I did to resolve the POSIX API issues at least: http://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/user/gcooper/posix-conformance-work/sys/cddl/compat/opensolaris/sys/time.h&REV=3 If you're going to redefine clock_t though, please define _CLOCK_T_DECLARED, but note that this will cause issues with ABI conformance across the board as FreeBSD defines it as one thing and Solaris defines it as another (so there might be some issues where FreeBSD and the opensolaris compat crossover). clock_t should be bumped to 64-bit on FreeBSD though IMO (based on the issues encountered and the utility in functions like clock(3)), but it might have some trickledown impact as filesystem datastructures (for instance) won't change size as they're on-disk structures (as I discovered several weeks ago when I proposed that the chflags syscalls be made consistent on FreeBSD :/...). Thanks! -Garrett