From owner-freebsd-current@FreeBSD.ORG Wed Jul 21 13:37:45 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 0CEEF16A4CE; Wed, 21 Jul 2004 13:37:45 +0000 (GMT) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77A4B43D54; Wed, 21 Jul 2004 13:37:44 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i6LDbg4u014338; Wed, 21 Jul 2004 23:37:42 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) i6LDbeao018604; Wed, 21 Jul 2004 23:37:41 +1000 Date: Wed, 21 Jul 2004 23:37:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Xin LI In-Reply-To: <20040721113211.GA1899@frontfree.net> Message-ID: <20040721232310.Y2587@epsplex.bde.org> References: <20040721113211.GA1899@frontfree.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 13:37:45 -0000 On Wed, 21 Jul 2004, Xin LI wrote: > Hi, Poul-Henning, > > It seems that rev. 1.23 of sys/sys/time.h has constrained timespec* macros > to be _KERNEL (KERNEL in the old days) only. Is this intended? (NetBSD and 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, NetBSD and OpenBSD originally only had timeval*(), and FreeBSD unfortunately 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. > as timespec structure is not _KERNEL protected :-) The timespec struct is POSIX standard. POSIX has the correct number of functions for operating on timespec structs (none). Bruce