From smp@rick.systemsix.com  Mon Jun  3 17:13:38 1996
Received: from rick.systemsix.com (rick.systemsix.com [198.99.86.136])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA29400
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 3 Jun 1996 17:13:22 -0700 (PDT)
Received: (from root@localhost) by rick.systemsix.com (8.7.5/8.7.3) id SAA27142; Mon, 3 Jun 1996 18:12:27 -0600 (MDT)
Message-Id: <199606040012.SAA27142@rick.systemsix.com>
Date: Mon, 3 Jun 1996 18:12:27 -0600 (MDT)
From: smp@csn.net
Reply-To: smp@csn.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: errno breaks in thread-safe c++ compiles
X-Send-Pr-Version: 3.2

>Number:         1289
>Category:       bin
>Synopsis:       errno breaks in thread-safe c++ compiles
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun  3 17:20:01 PDT 1996
>Closed-Date:    Fri Aug 23 20:49:48 PDT 1996
>Last-Modified:  Fri Aug 23 20:52:40 PDT 1996
>Originator:     Steve Passe
>Release:        FreeBSD 2.2-960501-SNAP i386
>Organization:
New Ideas
>Environment:

	FreeBSD 2.2-960501-SNAP, thread safe libc_r

>Description:

	In the thread-safe libc, specifically errno.h, there is a
	mechanism for using a unique copy of errno for each thread.
	This mechanism breaks when a progam compliled under c++
	uses errno (includes errno.h)

>How-To-Repeat:

	foo.cc:
		#include <errno.h>
		cerr << "problem: " << errno << '\n';
	g++ foo.cc:
		(mumbles about unresolvedfunction "__error__Fv")

>Fix:
	
	RCS file: RCS/errno.h,v
	retrieving revision 1.1
	diff -r1.1 errno.h
	47c47,49
	< extern	int *		__error();
	---
	> __BEGIN_DECLS
	> int * __error __P((void));
	> __END_DECLS

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Fri Aug 23 20:49:48 PDT 1996 
State-Changed-Why:  
I fixed this slightly differently in rev 1.5 of errno.h on 18/8/96, 
I also made it _THREAD_SAFE.. 
>Unformatted:
