From: Scott <drmemory@3rivers.net>
To: Samuel Bronson <naesten@gmail.com>
Cc: franta@hanzlici.cz, linux-msdos@vger.kernel.org,
freedos-user@lists.sourceforge.net
Subject: Re: DOS program recording it's parameters and environment?
Date: Fri, 17 Feb 2012 15:29:06 -0700 [thread overview]
Message-ID: <20120217222906.GB846@drmemory.local> (raw)
In-Reply-To: <CAJYzjmcCi_450Ph7WfTtsytujejzeT1R1HMW5xtWvLpCRSK1pQ@mail.gmail.com>
On Thu, Feb 16, 2012 at 08:57:46PM -0500, Samuel Bronson wrote:
> On Thu, Feb 16, 2012 at 4:01 PM, Paul Crawford <psc@sat.dundee.ac.uk> 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
prev parent reply other threads:[~2012-02-17 22:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 5:20 DOS program recording it's parameters and environment? Frantisek Hanzlik
[not found] ` <4F16E21B.9030804@gmail.com>
2012-01-18 17:46 ` Frantisek Hanzlik
2012-01-18 17:55 ` Frank Cox
2012-01-18 18:36 ` Frantisek Hanzlik
2012-01-18 19:17 ` Scott
2012-01-27 12:01 ` Paul Crawford
2012-02-16 18:54 ` Frantisek Hanzlik
2012-02-16 21:01 ` Paul Crawford
2012-02-16 21:34 ` Frantisek Hanzlik
2012-02-17 1:57 ` Samuel Bronson
2012-02-17 22:29 ` Scott [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120217222906.GB846@drmemory.local \
--to=drmemory@3rivers.net \
--cc=franta@hanzlici.cz \
--cc=freedos-user@lists.sourceforge.net \
--cc=linux-msdos@vger.kernel.org \
--cc=naesten@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox