ming exec forks ???

Mumit Khan khan@NanoTech.Wisc.EDU
Fri Dec 31 13:28:00 GMT 1999

Keraba <keraba@yahoo.com> 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.


Here's a trivial example:

   * spawn test:

  #include <stdio.h>
  #include <process.h>

  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;


Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

More information about the Cygwin mailing list