From: | Aaron Optimizer Digulla |
Date: | 8 Aug 2000 at 17:11:01 |
Subject: | fork() (Was: Re: AMIOPEN: ave_open()) |
Quoting Tim Corringham <tim@ramjam.u-net.com>:
> Now, often when a fork() is performed, the intention isn't to end up
> with two identical processes running, but to replace the child process
> with some other program and execute it by a call to exec(). Since
> copying the program, data, page tables etc is a waste of time if you're
> immediately going to discard them, a variant of fork() is available
> on many systems which doesn't actually perform the copy - vfork().
> This assumes the child will immediately call exec(), and trouble is
> likely if it doesn't!
All I have to add to this is:
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.
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(). When that function has become stable
(ie. some software has been ported to Ami), then I will propose
this to the debian guys to include in their code. Maybe they won't
but then we will not have lost countless hours in trying to write
a function which is overkill for what we need to do.
Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html