Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/