From owner-freebsd-hackers Mon Jun 28 19:18:15 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mycenae.ilion.eu.org (mycenae.ilion.eu.org [203.35.206.129]) by hub.freebsd.org (Postfix) with ESMTP id 624A114C23 for ; Mon, 28 Jun 1999 19:18:07 -0700 (PDT) (envelope-from patrykz@mycenae.ilion.eu.org) Received: from mycenae.ilion.eu.org (patrykz@localhost [127.0.0.1]) by mycenae.ilion.eu.org (8.9.2/8.9.2) with ESMTP id MAA29451 for ; Tue, 29 Jun 1999 12:18:07 +1000 (EST) (envelope-from patrykz@mycenae.ilion.eu.org) Message-Id: <199906290218.MAA29451@mycenae.ilion.eu.org> To: freebsd-hackers@FreeBSD.ORG Subject: Re: environment strings In-reply-to: Your message of "Tue, 29 Jun 1999 09:56:59 +0930." <19990629095659.B86806@freebie.lemis.com> Date: Tue, 29 Jun 1999 12:18:07 +1000 From: Patryk Zadarnowski Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I wanted t know where the environment strings i bsd were stored after a > > program execs another one. extern char **environ; > At the top of memory. You can access them by the standard (but > undocumented) method: > > int main (int argc, char *argv [], char *envp []) > > envp is a pointer to the environment strings. This is true for every > version of UNIX I know. This is of course correct except for the `undocumented' claim. The `envp' has been documented as the third argument to main() since the Pharaons (well, not quite ;). Apparently AT&T UNIX even has a (documented) five-parameter main(). Besides, the `envp' argument is a recommended extension in ISO/ANSI C, so you can hardly say that it's undocumented. l8r, patryk. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message