Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <20020604172523.29786.qmail@wildcard.curl.com>
From: "Bob Byrnes" <byrnes@curl.com>
Date: Tue, 4 Jun 2002 13:25:23 -0400
In-Reply-To: <1023172031.9514.ezmlm@cygwin.com>
       from cygwin-digest-help@cygwin.com (Jun  4,  6:27am)
Organization: Curl Corporation
X-Address: 400 Technology Square, 8th Floor, Cambridge, MA 02139
X-Phone: 617-761-1238
X-Fax: 617-761-1201
To: cygwin@cygwin.com
Subject: Re: ExitProcess() with negative argument -> zero exit status from wait*()

On Jun 4,  6:27am, cgf-cygwin@cygwin.com (Christopher Faylor) wrote:
-- Subject: Re: ExitProcess() with negative argument -> zero exit status ...
>
> On Mon, Jun 03, 2002 at 11:01:51PM -0400, Bob Byrnes wrote:
> + If a process exits by calling ExitProcess() with a negative argument,
> + then cygwin returns a zero exit status to the calling process.  This
> + seems wrong, and is different from the behavior of GetExitCodeProcess().
> 
> Don't mix the Windows API with the UNIX api.  You're asking for trouble.
> 
> If you have to exit, use exit() or _exit().
> 
> Either that, or go all of the way and don't use wait().  Start your process
> with CreateProcess and use WaitForSingleObject to wait for it.
> 
-- End of excerpt from Christopher Faylor

This isn't really an option if I am running a native (non-cygwin) win32 app
from a cygwin program like "make" or a shell.

The native win32 app, which is not (necessarily) under my control, is going
to use ExitProcess().  I really don't want to rewrite all of the cygwin apps
to use WaitForSingleObject() instead of wait() ;-).  I suppose I could
interpose a wrapper process that would spawn the win32 native app, then
do WaitForSingleObject() and finally call exit() to return the status to
the parent cygwin app, but that's a pain, and again it requires mixing
APIs, in the opposite direction.

I don't want to mix APIs.  I just want a clean interface between processes.
Shouldn't cygwin at least try to interoperate with native win32 apps?
Failing to do so really limits its usefulness, IMO.

Bob Byrnes                        e-mail: byrnes@curl.com
Curl Corporation                  phone:  617-761-1200
400 Technology Square, 8th Floor  fax:    617-761-1201
Cambridge, MA  02139

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

