Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site wjvax.wjvax.UUCP Path: utzoo!utcs!lsuc!pesnta!wjvax!brett From: brett@wjvax.UUCP (Brett Galloway) Newsgroups: net.unix-wizards Subject: Process control query (fork/exec) for BSD 4.2 Message-ID: <642@wjvax.wjvax.UUCP> Date: Fri, 17-Jan-86 13:04:54 EST Article-I.D.: wjvax.642 Posted: Fri Jan 17 13:04:54 1986 Date-Received: Sun, 19-Jan-86 07:41:35 EST Reply-To: brett@wjvax.UUCP (Brett Galloway) Organization: Watkins-Johnson Co., San Jose, Calif. Lines: 21 Keywords: fork, exec, process, bsd, 4.2 I am working on a program which must be able to fork and execvp an arbitrary relative path name (as in popen(3)). My question is whether there is any reliable for the parent to tell if the exec() in the forked child succeeded or failed. I tried doing a kill(pid,0) in the parent immediately after the fork (assuming that the fork succeeded), but that produces false negative results when the child executed very quickly. It might also produce false positive results if the parent gets to the kill(pid,0) before the child gets to the exec, although since I am using vfork() that has not happened to me. I would be interested to know how popen(), and how the shells (sh and csh) determine the success or failure of their exec()'s. Note that I cannot merely use an access(2) call on the pathname, since I am using execvp() to find relative paths. Thanks in advance. Brett Galloway ------------- Brett Galloway {pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett