From owner-freebsd-current@FreeBSD.ORG Wed Jul 21 15:14:20 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1A0916A4CE for ; Wed, 21 Jul 2004 15:14:20 +0000 (GMT) Received: from mail.FreeBSD.org.cn (dns3.freebsd.org.cn [61.129.66.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id D39C043D54 for ; Wed, 21 Jul 2004 15:14:15 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: (qmail 93278 invoked by uid 0); 21 Jul 2004 15:12:21 -0000 Received: from unknown (HELO beastie.frontfree.net) (219.239.98.7) by mail.FreeBSD.org.cn with AES256-SHA encrypted SMTP; 21 Jul 2004 15:12:21 -0000 Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 55D9D11524; Wed, 21 Jul 2004 23:14:13 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02660-06; Wed, 21 Jul 2004 23:14:02 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id C501811DBA; Wed, 21 Jul 2004 23:14:01 +0800 (CST) Date: Wed, 21 Jul 2004 23:14:01 +0800 From: Xin LI To: Bruce Evans Message-ID: <20040721151401.GA2458@frontfree.net> References: <20040721113211.GA1899@frontfree.net> <20040721232310.Y2587@epsplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <20040721232310.Y2587@epsplex.bde.org> User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-delphij FreeBSD 5.2-delphij #80: Thu Jun 24 17:30:33 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: current@freebsd.org Subject: Re: Any idea why timespec* is _KERNEL stuff only? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2004 15:14:21 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Bruce On Wed, Jul 21, 2004 at 11:37:40PM +1000, Bruce Evans wrote: > On Wed, 21 Jul 2004, Xin LI wrote: >=20 > > Hi, Poul-Henning, > > > > It seems that rev. 1.23 of sys/sys/time.h has constrained timespec* mac= ros > > to be _KERNEL (KERNEL in the old days) only. Is this intended? (NetBSD = and >=20 > Yes, this is intended. The timeval and timespec interfaces are optimized > for handling times in code that can't use 64-bit integers or floating > point (mainly in 20 year old kernels). New interfaces to manipulate them > should not be added 20 years after the interfaces should have been > deprecated. > > > OpenBSD don't expect _KERNEL for these macros, e.g. timespeccmp, and I > > personally think that these macros will be better for more generic use, >=20 > NetBSD and OpenBSD originally only had timeval*(), and FreeBSD unfortunat= ely > had to add them to be compatible. timespec*() seem to be even less needed > in userland than timeval*(), since no ports are broken by not having them. >=20 > > as timespec structure is not _KERNEL protected :-) >=20 > The timespec struct is POSIX standard. POSIX has the correct number of > functions for operating on timespec structs (none). Thanks for the information, Bruce! So this means I should use bintime instead of timespec if it is found in code? For the exact problem I went into: it's OpenBSD's cron which makes use of timespec (because of fstat). I think a _KERNEL || __BSD_VISIBLE might be helpful -- While it is possible to use bintime to represent what can be done with a timespeccmp macro. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --9amGYk9869ThD9tj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA/og5OfuToMruuMARAtxOAJ9ECSsiSmizfpStEGqlEUXH40EFiACfXuSe 05C9NccCIE45jgc1VWpuUWg= =77mn -----END PGP SIGNATURE----- --9amGYk9869ThD9tj--