Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199912030216.UAA06537@hp2.xraylith.wisc.edu> To: Keraba cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: ming exec forks ??? In-reply-to: Your message of "Thu, 02 Dec 1999 17:41:59 PST." <19991203014159 DOT 28712 DOT qmail AT web213 DOT mail DOT yahoo DOT com> Date: Thu, 02 Dec 1999 20:16:30 -0600 From: Mumit Khan Keraba writes: > Hi, > > I'm having trouble with the execv() system call. With the Cygwin > gcc and libraries it works fine, but with the Ming equivalents > it acts more like fork(), spawning off a child then continuing, > without waiting for the child to die first. I don't know what the problem is, but under windows, you probably want _spawnv[pe] instead. Go to MS web site and search the docs -- it's all online. > > I'm sorry, I'd write to the ming-gcc list if I knew of one. http://www.egroups.com/lists/mingw32/ Here's a trivial example: /* * spawn test: */ #include #include int main () { char *argv[3]; int retcode; /* Set up argv */ argv[0] = "ls"; argv[1] = "-l"; argv[2] = NULL; fprintf (stderr, "Spawing child: %s\n", argv[0]); retcode = _spawnvp (_P_WAIT, argv[0], argv); if (retcode == -1) perror (argv[0]); fprintf (stderr, "Child done: retcode = %d\n", retcode); return 0; } Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com