OpenAmiga (376/959)

From:Tim Corringham
Date:8 Aug 2000 at 23:32:45
Subject:Re: fork() (Was: Re: AMIOPEN: ave_open())

Hi Aaron

> GNU developers should have added a call to create child processes
> a long time ago. That would make porting software so much more simple.
> The function could call fork()/vfork()/exec() on Unix and whatever is
> necessary on any other system. As is now, everyone has to implement
> a very complicated and error-prone function just to create a child.

fork() is neither complicated nor error-prone on unix systems. It doesn't
easily map onto the process creation mechanisms used by many non-unix
systems, but that's not the fault of fork() - it was never intended to
be platform independent.
>
> The function which I created (ixemul_exec()) can do everything that
> is necessary to emulate fork()/exec(), so I see no reason to try to
> implement fork() or vfork().

Sometimes you want to fork() without doing an exec().

Sometimes you want to fork() and play around with the file desriptors
before calling exec() (which is important when implementing pipes).

Sometimes you want to issue a shell command and can use system() instead
of fork()/exec().

ixemul_exec() may be useful in many applications, but AFAIK it doesnt
emulate fork()/exec() in all cases.

Tim



======================================================================
Tim Corringham e-mail: tim@ramjam.u-net.com
Ramjam Consultants Ltd tel: +44 (0)118 946 5940
Reading, England fax: +44 (0)118 946 5941

Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html