From marcus@shumai.marcuscom.com  Sat Aug 31 18:01:35 2002
Return-Path: <marcus@shumai.marcuscom.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A26E637B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Aug 2002 18:01:35 -0700 (PDT)
Received: from shumai.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F32D243E42
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Aug 2002 18:01:34 -0700 (PDT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: from shumai.marcuscom.com (localhost.marcuscom.com [127.0.0.1])
	by shumai.marcuscom.com (8.12.5/8.12.5) with ESMTP id g81127Rw014576
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Aug 2002 21:02:07 -0400 (EDT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: (from marcus@localhost)
	by shumai.marcuscom.com (8.12.5/8.12.5/Submit) id g81126IX014575;
	Sat, 31 Aug 2002 21:02:06 -0400 (EDT)
Message-Id: <200209010102.g81126IX014575@shumai.marcuscom.com>
Date: Sat, 31 Aug 2002 21:02:06 -0400 (EDT)
From: Joe Marcus Clarke <marcus@freebsd.org>
Reply-To: Joe Marcus Clarke <marcus@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Fix unresolved _thread_fd_getflags symbol in -stable
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42272
>Category:       bin
>Synopsis:       [PATCH] Fix unresolved _thread_fd_getflags symbol in -stable
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    archie
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 31 18:10:01 PDT 2002
>Closed-Date:    Sat Aug 31 19:10:36 PDT 2002
>Last-Modified:  Sat Aug 31 19:10:36 PDT 2002
>Originator:     Joe Marcus Clarke
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
MarcusCom, Inc.
>Environment:
System: FreeBSD shumai.marcuscom.com 4.6-STABLE FreeBSD 4.6-STABLE #0: Thu Aug 22 01:22:19 EDT 2002 marcus@shumai.marcuscom.com:/usr/obj/usr/src/sys/SHUMAI i386


	
>Description:
After a cvsup and buildworld of -stable Sat Aug 31 20:26:19 EDT 2002, all 
binaries linked to libc_r (-pthread) fail with the following error:

/usr/libexec/ld-elf.so.1: /usr/lib/libc_r.so.4: Undefined symbol "_thread_fd_getflags"

This looks to have been caused by a mangled MFC.
>How-To-Repeat:
Try to run any threaded application on the above mentioned -stable.
>Fix:
This patch fixes things for me, and seems to be the way the functions are
aligned in -CURRENT.

--- src/lib/libc_r/uthread/uthread_fd.c.orig	Sat Aug 31 20:51:21 2002
+++ src/lib/libc_r/uthread/uthread_fd.c	Sat Aug 31 20:52:51 2002
@@ -180,6 +180,22 @@
 	return (ret);
 }
 
+int
+_thread_fd_getflags(int fd)
+{
+	if (_thread_fd_table[fd] != NULL)
+		return (_thread_fd_table[fd]->flags);
+	else
+		return (0);
+}
+
+void
+_thread_fd_setflags(int fd, int flags)
+{
+	if (_thread_fd_table[fd] != NULL)
+		_thread_fd_table[fd]->flags = flags;
+}
+
 #ifdef _FDLOCKS_ENABLED
 void
 _thread_fd_unlock(int fd, int lock_type)
@@ -493,21 +509,6 @@
 	return (ret);
 }
 
-int
-_thread_fd_getflags(int fd)
-{
-	if (_thread_fd_table[fd] != NULL)
-		return (_thread_fd_table[fd]->flags);
-	else
-		return (0);
-}
-
-void
-_thread_fd_setflags(int fd, int flags)
-{
-	if (_thread_fd_table[fd] != NULL)
-		_thread_fd_table[fd]->flags = flags;
-}
 
 void
 _thread_fd_unlock_debug(int fd, int lock_type, char *fname, int lineno)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->archie 
Responsible-Changed-By: marcus 
Responsible-Changed-When: Sat Aug 31 18:29:17 PDT 2002 
Responsible-Changed-Why:  
Over to archive, who last touched the libc_r code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42272 
State-Changed-From-To: open->closed 
State-Changed-By: archie 
State-Changed-When: Sat Aug 31 19:10:17 PDT 2002 
State-Changed-Why:  
Should be fixed now. Thanks for the report! 

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