thread-safe popen

Dan Nelson dnelson at allantgroup.com
Thu Jul 7 07:13:44 GMT 2005


In the last episode (Jul 07), Dipjyoti Saikia said:
> On 7/5/05, Dan Nelson <dnelson at allantgroup.com> 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 at allantgroup.com


More information about the freebsd-hackers mailing list