Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!uxc!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.sys.ibm.pc Subject: Re: HELP: MSC system call Message-ID: <21207@iuvax.cs.indiana.edu> Date: 25 May 89 22:03:38 GMT Reply-To: bobmon@iuvax.cs.indiana.edu (RAMontante) Distribution: comp Organization: malkaryotic Lines: 25 -In article <4267@druhi.ATT.COM> deln@druhi.ATT.COM (SloaneN) writes: -> ->eg. exit_code= system( "cl -E ......" ); -> ->if "cl" fails, I still get a zero return code because the "system" ->command successfully spawned "cl". What I want is the exit code ->from "cl". kneller@socrates.ucsf.edu.UUCP (Don Kneller) <11624@cgl.ucsf.EDU> : - -The problem (which has been there forever), is that the system() -call actually spawns the following: - - command /c cl -E ... - -That is, command.com is spawned and it in turn spawns cl. However, Depending on the application, you may be able to just spawn() the "cl" program directly. If possible, this is faster and uses less system resource anyway. spawn() returns the child's exit value (>= 0, of course) or -1 if the child process didn't occur (e.g., not enough memory). spawn() is actually a family of functions that create and run child processes. Like a "fork()/exec()" sequence under Unix. Turbo C has spawn(), I assume that MSC has something like it too.