From jhein@timing.com  Thu Mar 21 08:52:36 2002
Return-Path: <jhein@timing.com>
Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218])
	by hub.freebsd.org (Postfix) with ESMTP id 26A4F37B417
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Mar 2002 08:52:36 -0800 (PST)
Received: from Elmer.timing.com (elmer.timing.com [206.168.13.187])
	by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id g2LGqZW81691
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Mar 2002 09:52:35 -0700 (MST)
	(envelope-from jhein@timing.com)
Received: (from jhein@localhost)
	by Elmer.timing.com (8.11.6/8.11.6) id g2LGqZH50416;
	Thu, 21 Mar 2002 09:52:35 -0700 (MST)
	(envelope-from jhein)
Message-Id: <200203211652.g2LGqZH50416@Elmer.timing.com>
Date: Thu, 21 Mar 2002 09:52:35 -0700 (MST)
From: "John E. Hein" <jhein@timing.com>
Reply-To: "John E. Hein" <jhein@timing.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: _THREAD_SAFE & _REENTRANT used inconsistently
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36167
>Category:       bin
>Synopsis:       _THREAD_SAFE & _REENTRANT used inconsistently
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gerald
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 21 09:00:02 PST 2002
>Closed-Date:    Wed Jun 25 09:13:27 PDT 2003
>Last-Modified:  Wed Jun 25 09:13:27 PDT 2003
>Originator:     John E. Hein
>Release:        FreeBSD 4.5-RELEASE
>Organization:
Timing Solutions Corporation
>Environment:
System: -STABLE & -CURRENT


>Description:
	stdio.h uses _THREAD_SAFE
	math.h & openssl/e_os.h use _REENTRANT

	On linux, _THREAD_SAFE & _REENTRANT are documented to be
	synonymous (in /usr/include/features.h).  I don't know what
	POSIX has to say on the issue (although it looks like they use
	_POSIX_THREAD_SAFE_FUNCTIONS - see comment in unistd.h).

	Of course, _REENTRANT is not mentioned in gcc(1) whereas
	_THREAD_SAFE is.

>How-To-Repeat:
	egrep -r '_REENTRANT|_THREAD_SAFE' /usr/include

>Fix:

	Until a possibly better, more posix compliant, solution comes
	along, either:
	 - Have headers use just _THREAD_SAFE or _REENTRANT
	 or
	 - Have headers use treat _THREAD_SAFE or _REENTRANT
	    the same.
>Release-Note:
>Audit-Trail:

From: "John E Hein (work)" <jhein@timing.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/36167: _THREAD_SAFE & _REENTRANT used inconsistently
Date: Thu, 21 Mar 2002 10:14:14 -0700

 See also docs/36168
 
State-Changed-From-To: open->feedback 
State-Changed-By: gerald 
State-Changed-When: Tue Jun 17 13:10:17 PDT 2003 
State-Changed-Why:  
As far as I can see this has been thoroughly fixed for FreeBSD 5.1 (and 
above) where _neither_ of these two constants is #used any longer, but I'm 
afraid backporting these fixes to 4.x is too involved. 
In the light of this, would you agree that I close this PR? 


Responsible-Changed-From-To: freebsd-bugs->gerald 
Responsible-Changed-By: gerald 
Responsible-Changed-When: Tue Jun 17 13:10:17 PDT 2003 
Responsible-Changed-Why:  
I'll try to follow this through. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36167 

From: John E Hein <jhein@timing.com>
To: Gerald Pfeifer <gerald@FreeBSD.org>
Cc: freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/36167: _THREAD_SAFE & _REENTRANT used inconsistently
Date: Tue, 17 Jun 2003 14:25:03 -0600

 If the headers don't need them, is the documentation of the -pthread
 option in gcc(1) accurate (says -D_THREAD_SAFE should be supplied when
 compiling with -pthread)?  I assume not.
 
 If not, then this bug becomes just a documentation bug for -current.

From: Gerald Pfeifer <gerald@FreeBSD.org>
To: John E Hein <jhein@timing.com>
Cc: freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/36167: _THREAD_SAFE & _REENTRANT used inconsistently
Date: Tue, 17 Jun 2003 22:34:59 +0200 (CEST)

 On Tue, 17 Jun 2003, John E Hein wrote:
 > If the headers don't need them, is the documentation of the -pthread
 > option in gcc(1) accurate (says -D_THREAD_SAFE should be supplied when
 > compiling with -pthread)?  I assume not.
 >
 > If not, then this bug becomes just a documentation bug for -current.
 
 I'm afraid this is the case and have just notified the responsible
 parties.
 
 The source of the problem, of course, is that this really shouldn't
 have been added to the GCC man pages, because it is not related to
 GCC at all (but a libc issue).
 
 Gerald
State-Changed-From-To: feedback->closed 
State-Changed-By: obrien 
State-Changed-When: Wed Jun 25 09:12:18 PDT 2003 
State-Changed-Why:  
gcc manpage fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36167 
>Unformatted:
