From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 07:13:44 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B0E416A41C for ; Thu, 7 Jul 2005 07:13:44 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23D2443D48 for ; Thu, 7 Jul 2005 07:13:43 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j677DhH4090470; Thu, 7 Jul 2005 02:13:43 -0500 (CDT) (envelope-from dan) Date: Thu, 7 Jul 2005 02:13:43 -0500 From: Dan Nelson To: Dipjyoti Saikia Message-ID: <20050707071343.GD38925@dan.emsphone.com> References: <20050705143814.GA38925@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: freebsd-hackers@freebsd.org Subject: Re: thread-safe popen X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2005 07:13:44 -0000 In the last episode (Jul 07), Dipjyoti Saikia said: > On 7/5/05, Dan Nelson wrote: > > In the last episode (Jul 05), Dipjyoti Saikia said: > > > I am working on an OS derived for BSD 4.1 . I am trying to > > > backport a thread-safe version of popen() from BSD 4.10 . > > > > popen should be threadsafe as of rev 1.17 (2003-01-03) of > > /usr/src/lib/libc/gen/popen.c . It was merged into the 4.* branch in > > rev 1.14.2.1 (2004/12/15). The PR is bin/50770 . Do you have a > > testcase that causes it to fail? > Please find the code snippet of popen() from the source code that I > have (We are working on an OS that is derived from FreeBSD 4.1) . I > don't think I have the thread safe version . Correct; you need to look at the 4.11 source. 4.10's popen wasn't thread-safe. This link will get you the diffs between 4.1 and 4.11 which will make popen thread-safe: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/popen.c.diff?r1=RELENG_4_1_0_RELEASE&r2=RELENG_4_11_0_RELEASE -- Dan Nelson dnelson@allantgroup.com