delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/29/15:52:11

From: newsham AT lava DOT net (Tim Newsham)
Subject: spawn and wait?
29 Dec 1997 15:52:11 -0800 :
Message-ID: <m0xmnJa-00110YC.cygnus.gnu-win32@malasada.lava.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

   I'm not too clear on the semantics of spawn since I haven't
come across any documentation for it.  I assume its a way to
spawn a process without the fork/exec expenses (using just 1
CreateProcess instead of two).  So I ran some simple tests and
found what I think might be a bug:

    #include <process.h>

    main()
    {
        int stat;

        stat = spawnl(_P_NOWAIT, 
            "/gnuwin32/b18/H-i386-cygwin32/bin/sleep.exe", "sleep", "5", 0);
        printf("spawned (%d).  waiting\n", stat);
        wait(&stat);
        printf("status %x\n", stat);
    }


when I run this I get:

    spawned (40).  waiting
    [pause]
    wait_found: CloseHandle thread failed
    status 0

I tried other spawn flags and I seem to get that error when I use
NOWAIT or NOWAITO.  Cygwin version is based off of a sept snapshot
with some local changes (nothing involving spawn or wait).

                                         Tim N.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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