This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygwin 1.5.11: execv doesn't set argv[0] on Windows programs
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 10 Sep 2004 08:50:48 -0400
- Subject: Re: cygwin 1.5.11: execv doesn't set argv[0] on Windows programs
- References: <Pine.GSO.4.61.0409100001520.2335@slinky.cs.nyu.edu>
- Reply-to: cygwin at cygwin dot com
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/