delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/12/02/21:18:26

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
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 <keraba AT yahoo DOT com>
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 <khan AT NanoTech DOT Wisc DOT EDU>

Keraba <keraba AT yahoo DOT 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.

http://www.egroups.com/lists/mingw32/

Here's a trivial example:

  /* 
   * spawn test:
   */

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

  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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019