Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 10 Sep 2004 08:50:48 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: cygwin 1.5.11: execv doesn't set argv[0] on Windows programs
Message-ID: <20040910125048.GB7514@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <Pine.GSO.4.61.0409100001520.2335@slinky.cs.nyu.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.GSO.4.61.0409100001520.2335@slinky.cs.nyu.edu>
User-Agent: Mutt/1.4.1i

On Fri, Sep 10, 2004 at 12:38:31AM -0400, Igor Pechtchanski wrote:
>Hi,
>
>I'm getting the following behavior consistently:
>
>$ bash -c 'exec -a KKKK java -h' 2>&1 | egrep 'options?]'
>Usage: java.exe [-options] class [args...]
>   or  java.exe [-jar] [-options] jarfile [args...]
>$
>
>but
>
>$ bash -c 'exec -a KKKK bash --help' 2>&1 | egrep 'options?]'
>Usage:  KKKK [GNU long option] [option] ...
>        KKKK [GNU long option] [option] script-file ...
>$
>
>In other words, invoking a Cygwin program sets argv[0] correctly, but
>invoking a Windows program doesn't.  Interestingly enough, using the MinGW
>execv works properly:

There is no such thing as "argv[0]" for a Windows program.  Cygwin uses
CreateProcess to create processes.  CreateProcess does not have the concept
of "argv[0]".  Perhaps Microsoft's exec functions do something funky that
is understood by other msvcrt programs.  Cygwin doesn't do that.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

