Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mtune!codas!usfvax2!chips From: chips@usfvax2.UUCP (Chip Salzenberg) Newsgroups: comp.arch,comp.unix.wizards,comp.os.minix Subject: Re: Free Software Foundation (was: Re: Mach, the new standard?) Message-ID: <838@usfvax2.UUCP> Date: Sat, 19-Sep-87 13:12:44 EDT Article-I.D.: usfvax2.838 Posted: Sat Sep 19 13:12:44 1987 Date-Received: Sun, 20-Sep-87 16:31:17 EDT References: <1665@ncr-sd.SanDiego.NCR.COM> <8381@utzoo.UUCP> <797@Pescadero.ARPA> <7320@felix.UUCP> Organization: AT Engineering, Tampa, FL Lines: 31 Summary: Forking revisited Xref: mnetor comp.arch:2258 comp.unix.wizards:4353 comp.os.minix:1680 In article <7320@felix.UUCP>, preston@felix.UUCP writes: > > Most uses of fork() are immediately followed by an exec() call. Why > else do you think the BSD people came up with vfork()? A direct "start > program in a seperate process" call would accomplish the same effect > and would be easily implementable on machines without hardware support > for (the right flavor of) virtual memory. There is one thing about UNIX fork()-exec() that you've overlooked -- after the fork(), the child process can set up the environment of the soon-to-be-exec'ed process by modifying its own environment. (Can you say `pipes, I/O redirection and current directory'? I knew you could.) > I'd rather see primitives like "start process in same address space", > "start process in new address space", and "start program in new > address space". > -- > Preston L. Bannister Under OS-9, there is no UNIX-style fork(); there is a combined fork()-exec(). Granted that it's efficient on 6809 and 680x0 even without an MMU, it's still a royal pain. The parent process must dup() its file descriptors, open the child's, fork(), close the child's, and restore its own. And those dup'ed file descriptors are still open on the child! Blech. I'd like `new process, same address space', but for spawning another program, E{NIX semanitics are elegant and useful. -- Chip Salzenberg UUCP: "uunet!ateng!chip" or "chips@usfvax2.UUCP" A.T. Engineering, Tampa Fidonet: 137/42 CIS: 73717,366 "Use the Source, Luke!" My opinions do not necessarily agree with anything.