delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/10/08:49:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 10 Sep 2004 08:50:48 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT 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 AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 61 DOT 0409100001520 DOT 2335 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
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/

- Raw text -


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