From owner-svn-src-head@FreeBSD.ORG Mon Aug 15 12:09:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 29D73106568A; Mon, 15 Aug 2011 12:09:01 +0000 (UTC) Date: Mon, 15 Aug 2011 12:09:01 +0000 From: Alexander Best To: Bruce Evans Message-ID: <20110815120901.GC21258@freebsd.org> References: <201108082036.p78KarlR062810@svn.freebsd.org> <20110809105824.P896@besplex.bde.org> <20110810103831.GA60858@freebsd.org> <20110810230856.M2222@besplex.bde.org> <20110810154956.GA4034@freebsd.org> <20110815013423.E2968@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110815013423.E2968@besplex.bde.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric , Jonathan Anderson Subject: Re: svn commit: r224721 - head/sys/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: Mon, 15 Aug 2011 12:09:01 -0000 On Mon Aug 15 11, Bruce Evans wrote: > On Wed, 10 Aug 2011, Alexander Best wrote: > > >On Wed Aug 10 11, Bruce Evans wrote: > >>On Wed, 10 Aug 2011, Alexander Best wrote: > >>>any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being > >>>executed > >>>in a > >>> > >>>do { ... } while (0) > >>> > >>>conditional loop? > >> > >>Just the usual syntactical trick for making large macros that look > >>like function calls almost usable like function calls. Without the > >... > >thanks a lot for the in depth information. :) any reason, back in the > >days, it > >was decided that the functionality of converting a timespec to a timeval > >and > >vice versa should be implemented as a macro and not a function? > > Macros avoid some namespace pollution problems, and all the old kernel > timeval manipulation interfaces are either extern functions or macros, > partly because inline functions didn't exist when these interfaces were > designed. But the TIME* macros still have gratuitously different styles: > 1) they are spelled in upper case (which is "correct" since they are unsafe > macros, but this is not done for the other timeval macros which are > almost > all unsafe) > 2) FreeBSD moved their definitions from (where 4.4BSD-Lite > put them) to . This is not incorrect (since > is an old header that should only declare timeval interfaces (POSIX > put timespec interfaces in ). However, the move became out of > date before it was done (in 2001) because had already > grown several other timespec interfaces which were not moved. But these > were kernel-only, so they didn't cause namespace problems. Now > has grown several more user timespec interfaces. thanks for the explanation. :) > > Bruce