From owner-freebsd-current@FreeBSD.ORG Tue Jun 26 20:31:29 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 716BE16A41F for ; Tue, 26 Jun 2007 20:31:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 1605C13C45B for ; Tue, 26 Jun 2007 20:31:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l5QKVPNU039115; Tue, 26 Jun 2007 16:31:26 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Luigi Rizzo Date: Tue, 26 Jun 2007 16:25:00 -0400 User-Agent: KMail/1.9.6 References: <20070626040758.A48170@xorpc.icir.org> <20070626123130.A58530@xorpc.icir.org> In-Reply-To: <20070626123130.A58530@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706261625.00565.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 26 Jun 2007 16:31:26 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3532/Tue Jun 26 14:23:24 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: current@freebsd.org, fabio@gandalf.sssup.it Subject: Re: 'static inline' vs macros for kernel functions ? (was how to handle name clashes in linux/freebsd kernel sources ?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 26 Jun 2007 20:31:29 -0000 On Tuesday 26 June 2007 03:31:30 pm Luigi Rizzo wrote: > This is related to the post attached at the end of this email. > > In this commit: > > CVS log for src/sys/sys/systm.h > Revision 1.252: download - view: text, markup, annotated - select for diffs > Fri Mar 9 22:41:01 2007 UTC (3 months, 2 weeks ago) by jhb > > msleep() changed from a function to a macro wrapping _sleep(). > > Being a macro, it is a lot harder to hide it in case of name clashes > such as the one mentioned below. > > This raises the question - what is the point in using macros > in cases like this where we could use static inline function and > probably even exploit better compiler checks ? > > Would it be possible to revert msleep() to a real function ? FreeBSD already uses macros all over the place in sys/*.h. Go duke it out with bde@. :) You can always #undef msleep and redefine it to something else. -- John Baldwin