Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!tomliew From: tomliew@itsgw.rpi.edu (TomLiew) Newsgroups: comp.os.msdos.programmer Subject: Re: spawn problem Message-ID: <7Z^&X`#@rpi.edu> Date: 7 Feb 91 02:09:20 GMT References: Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 35 Nntp-Posting-Host: jec423.its.rpi.edu Sender:%N Distribution:comp.sys.ibm.pc.programmer,comp.os.msdos.programmer In article chas@stax.uchicago.edu (Charles Blair) writes: > >I'm spawning a child program written in assembly language from a >parent written in C as follows: > > spawnlp(P_WAIT,"WHATEVER.EXE","",NULL); > exit(0); [ stuff deleted ...] > >-- >Bitnet: pmrcjdb@uchimvs1 >Internet: cjdb@midway.uchicago.edu You forgot arg0. If you look inside the reference manual you fill find spawnlp defined as follows: int spawnlp(int mode, char *cmdname, char *arg0, char *arg1,...,argn,NULL); cmdname : Path name of the file to be executed. arg0,...argn : List of pointers to arguments, terminated by NULL. At least one argument, arg0, must be passed to the child process(which sees it as argv[0]). This argument is usually a copy of the cmdname i.e a pointer to the path The statement should then be : spawnlp(P_WAIT,"whatever.exe","whatever",NULL); ...... ******************************************************* -- Thomas Liew Internet : tomliew@itsgw.rpi.edu Physics Dept. RPI Bitnet : fhv1@rpitsmts Troy, NY12180 *******************************************************************