From owner-freebsd-arch Thu Jan 23 13:50:37 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC25837B405 for ; Thu, 23 Jan 2003 13:50:33 -0800 (PST) Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC26F43F43 for ; Thu, 23 Jan 2003 13:50:32 -0800 (PST) (envelope-from ben@timing.com) Received: from piglet.timing.com (piglet.timing.com [206.168.13.178]) by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id h0NLoTH02045; Thu, 23 Jan 2003 14:50:29 -0700 (MST) (envelope-from ben@timing.com) Received: from piglet.timing.com (localhost.timing.com [127.0.0.1]) by piglet.timing.com (8.12.6/8.12.6) with ESMTP id h0NLoTvR038340; Thu, 23 Jan 2003 14:50:29 -0700 (MST) (envelope-from ben@piglet.timing.com) Received: (from ben@localhost) by piglet.timing.com (8.12.6/8.12.6/Submit) id h0NLoSwb038337; Thu, 23 Jan 2003 14:50:28 -0700 (MST) From: Ben Mesander MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15920.25508.766136.494182@piglet.timing.com> Date: Thu, 23 Jan 2003 14:50:28 -0700 To: Warner Losh Cc: Daniel Eischen , ben@timing.com, freebsd-arch@FreeBSD.ORG Subject: Re: _REENTRANT in math.h & libm oddities. In-Reply-To: <200301232122.h0NLM31e003077@harmony.village.org> References: <200301232122.h0NLM31e003077@harmony.village.org> X-Mailer: VM 7.00 under Emacs 21.2.93.1 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Warner Losh writes: > In message Daniel Eischen writes: > : The gcc manpage is wrong. It should state _REENTRANT instead of > : _THREAD_SAFE. POSIX specifies that _REENTRANT be defined to get > : these functions. I know that we always provide implementations > : of most of these _r functions so it might not make sense to > : #ifdef them in the header files, but I don't know that always > : making them visible would be against the spec or cause namespace > : pollution. > > Then FreeBSD's source tree is basically wrong, since it uses > _THREAD_SAFE for this in many places. But most of them appear to be > just defining the macro for compiles and such. There's a little bit > in libc's stdio still, but that's the only significant place that uses > it in the tree. I'm not sure about out-of-tree software. Lots of things for various UNIX flavors seem to use _REENTRANT (see contrib & ports for examples). But even so, I disagree that the _r function definitions should only appear in math.h if _REENTRANT is defined. That is, I disagree unless the POSIX specification says otherwise; I've been surprised by it before. I was unaware that POSIX mentioned _REENTRANT. You can call _r functions even if you are not a threaded application. Other _r functions in libc, etc. can be called even if you are not threaded; I don't see why the gamma functions in the math library would be different. Regards, Ben To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message