From owner-freebsd-arch Thu Jan 23 8:28:19 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 CFDC637B401 for ; Thu, 23 Jan 2003 08:28:17 -0800 (PST) Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF5B243EB2 for ; Thu, 23 Jan 2003 08:28:16 -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 h0NGSGH98139 for ; Thu, 23 Jan 2003 09:28:16 -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 h0NGSGvR035710 for ; Thu, 23 Jan 2003 09:28:16 -0700 (MST) (envelope-from ben@piglet.timing.com) Received: (from ben@localhost) by piglet.timing.com (8.12.6/8.12.6/Submit) id h0NGSFgw035707; Thu, 23 Jan 2003 09:28:15 -0700 (MST) From: Ben Mesander MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15920.6175.737639.566519@piglet.timing.com> Date: Thu, 23 Jan 2003 09:28:15 -0700 To: freebsd-arch@freebsd.org Subject: _REENTRANT in math.h & libm oddities. 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 Greetings, Recently while working on some threading issues I noticed an oddity in /usr/include/math.h : the definitions of two functions, gamma_r and lgamma_r, are protected with #ifdef _REENTRANT . I suspect this is a historical artifact, as the FreeBSD manpage for gcc indicates that -D_THREAD_SAFE is the proper way to indicate that you are compiling threaded code on FreeBSD. I think the correct fix for this is to remove the #ifdef _REENTRANT from math.h . But perhaps it is there for a reason I am not cognizant of. If that is the case, wouldn't we be better served by using _THREAD_SAFE in FreeBSD? Also note that there are reentrant API's available for gammaf & lgamma: gammaf_r and lgammaf_r, but there are no prototypes for these in math.h. Additionally, there is no mention of the four functions gamma_r, lgamma_r, gammaf_r, and lgammaf_r on the lgamma(3) man page. Is it worthwhile to work up a patch to: - remove _REENTRANT from math.h (and replace with _THREAD_SAFE if people think that is appropriate) - add prototypes for gammaf_r & lgammaf_r to math.h - update the lgamma(3) man page to mention gamma_r, lgamma_r, gammaf_r, and lgammaf_r ? Regards, Ben To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message