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
In-Reply-To: <Pine.WNT.4.44.0409101230520.956-100000@drogers2k.spss.com>
To: "David A. Rogers" <darogers@speakeasy.net>
Cc: cygwin@cygwin.com, Dave Korn <dk@artimi.com>
Subject: RE: cygwin 1.5.11: execv doesn't set argv[0] on Windows programs
MIME-Version: 1.0
Message-ID: <OF11317D53.7B086299-ON85256F0B.006544CE-85256F0B.0065AD2C@abinitio.com>
From: Chuck McDevitt <cmcdevitt@ABINITIO.COM>
Date: Fri, 10 Sep 2004 14:30:35 -0400
Content-Type: text/plain; charset="US-ASCII"
X-IsSubscribed: yes

argv and argc are concepts from the C runtime, not the Windows OS.

The actual entry point to your program is to a routine that calls the 
initialization routines of the C library, then calls winMain.

Those initialization routines get the command line via Win32 call, 
allocates memory for argv, and parses the command line.

Windows itself has no requirement that an application support argv and 
argc, and in fact programs in other languages (VB etc) don't have any such 
concept.

Cygwin, when launching an application, just needs to make sure the 
CreateProcess call has the command line passed to it.
Everything else is handled by the the receiving program (via C runtime, if 
a C program).


--
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/

