Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: system Message-ID: <7152@brl-smoke.ARPA> Date: 21 Jan 88 16:07:15 GMT References: <127@dcrbg1.UUCP> <452@picuxa.UUCP> <3920@sigi.Colorado.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <3920@sigi.Colorado.EDU> swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) writes: >Just curious, but what do fork() and wait() do? I have Turbo C, and it has >execlp(), but neither of the other two. Does it have something to do with >the fact that UNIX is multiuser, while MS-DOS is not? Yes, exactly. fork() creates a duplicate process image that shares the same open files; it returns 0 in the "child" process and the child's ID number in the "parent" process, both of which are then concurrently executing. exec() simply overlays a process image from a file on top of the currently executing one, then starts execution at its new entry point; the process ID remains unchanged. The combination of the two effectively "spawns" a new subprocess.