Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2003 09:28:15 -0700
From:      Ben Mesander <ben@timing.com>
To:        freebsd-arch@freebsd.org
Subject:   _REENTRANT in math.h & libm oddities.
Message-ID:  <15920.6175.737639.566519@piglet.timing.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15920.6175.737639.566519>