From owner-svn-src-projects@FreeBSD.ORG Thu Feb 23 19:10:33 2012 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DA8106564A; Thu, 23 Feb 2012 19:10:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5AD8FC1B; Thu, 23 Feb 2012 19:10:32 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q1NJAWuG023288; Thu, 23 Feb 2012 23:10:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q1NJAWZZ023287; Thu, 23 Feb 2012 23:10:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 23 Feb 2012 23:10:32 +0400 From: Gleb Smirnoff To: Bruce Evans Message-ID: <20120223191032.GW92625@FreeBSD.org> References: <201202231019.q1NAJObb099152@svn.freebsd.org> <20120224034735.T1834@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120224034735.T1834@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r232044 - projects/pf/head/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 19:10:33 -0000 Bruce, On Fri, Feb 24, 2012 at 04:30:53AM +1100, Bruce Evans wrote: B> This is the old Net/2 and 4.4BSD API (extended). One of the bugs in B> it is that it users the generic name `timer' for just one of the types B> of time-related structures, and even that type is time-related, not B> always timer-related. This timeval type should have gone away with POSIX B> timespecs in 1988, so it is the one least deserving of the generic name. B> B> FreeBSD started fixing this in 1998 by renaming the above to timeval*() B> in the kernel. Unfortunately, the old APIs remained as compatibility B> cruft for userland (now under ifdefs). FreeBSD also added timespec*() B> macros in 1998. B> B> timevaladd() and timevalsub() were correctly spelled and correctly B> implemented as functions in FreeBSD-1. FreeBSD extended the old B> mistakes in 1996 by adding timeradd() and timersub() macros for NetBSD B> userland compatibility. These are heavier-weight and otherwise more B> suitable for being functions than the others, so they were only B> functions, and were correctly named too. timespecadd() and B> timespecsub() are simalarly better implemented as functions, but FreeBSD B> added macros for them in 1998, while intentionally not doing this for B> timevaladd() and timevalsub(). But there is a problem with any of B> these API being functions in userland, since the functions have never B> been in libc. Hacking on time.h is easier than adding them in libc. B> Even correct hacking on time.h for them would be easier than changing B> libc. The 1996-2012 hacking is missing visibility ifdefs, and gives B> unsafe macros although their names indicate that they are safe. B> B> POSIX extended the lifetime of timevals by standardizing them 2001. B> 13 years wasn't long enough for them to go away. Now, 24 years hasn't B> been long enough. Thanks for important comments. Is the fix in r232062 okay? -- Totus tuus, Glebius.