This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin 1.5.11: execv doesn't set argv[0] on Windows programs


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]