Making a popen replacement with vfork()

Steve Dempsey steved at longs.LANCE.ColoState.Edu
Thu May 3 04:07:58 AEST 1990


In article <6830 at jarthur.Claremont.EDU>, jseidman at jarthur.Claremont.EDU
(James Seidman) writes:
> I'm working on a program which uses popen() several times to run on an
> ULTRIX workstation.  ...  My problem is that every time a popen()
> occurs, the system grinds to a halt.  What I suspect is happening is that
> popen() calls fork()... 

I've just looked at the source and it is indeed fork().

>  Since the system is ULTRIX I can't
> just pull it out of the BSD source, of course.

It's certainly worth a try.  Before we had Ultrix source, I often
used BSD source to replace uncooperative pieces of Ultrix, both
kernel and user code.  In this case, the diffs between Ultrix3.1
and 4.3BSD (MORE/BSD) versions of /usr/src/sys/lib/libc/gen/popen.c
are minimal.

If that fails, you should be able to roll your own popen() using
pipe(), vfork(), and exec?() to suit your application.


        Steve Dempsey,  Center for Computer Assisted Engineering
  Colorado State University, Fort Collins, CO  80523    +1 303 491 0630
INET: steved at longs.LANCE.ColoState.Edu, dempsey at handel.CS.ColoState.Edu
UUCP: boulder!ccncsu!longs.LANCE.ColoState.Edu!steved, ...!ncar!handel!dempsey



More information about the Comp.unix.questions mailing list