From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Subject: Re: DOS program recording it's parameters and environment? Date: Fri, 17 Feb 2012 15:29:06 -0700 Message-ID: <20120217222906.GB846@drmemory.local> References: <4F165699.1080204@hanzlici.cz> <4F229215.1040801@sat.dundee.ac.uk> <4F3D50CF.4000004@hanzlici.cz> <4F3D6EC1.4050100@sat.dundee.ac.uk> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-msdos-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Samuel Bronson Cc: franta@hanzlici.cz, linux-msdos@vger.kernel.org, freedos-user@lists.sourceforge.net On Thu, Feb 16, 2012 at 08:57:46PM -0500, Samuel Bronson wrote: > On Thu, Feb 16, 2012 at 4:01 PM, Paul Crawford wrote: > > Dear Frantisek, > > > >> compiler v1.9 (http://www.openwatcom.org/) for DOS. And there I knock > >> to problem - it seems as this compiler not support construction: > >> > >> int main(int argc, char *argv[], char *envp[]) > > > > I think this 3rd argument may be a MS-specific extension, as most C programs > > just have argc & argv in the call to main(); > > This is not actually MS-specific; I see it in my execve(2) manpage > here on Linux, and Got curious and pulled down my "Let's C" (Mark Williams Company) manual from 1987. envp - Argument passed to main char *envp[]; ... and is by convention the third argument passed to main. ... Note that Let's C calls main(argc, argv, NULL); however, envp is significant under some other operating systems, including TOS, UNIX and COHERENT. If of any interest. Scott Swanson