Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ucbcad!ucbvax!decvax!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Accessing argc/argv/envp Message-ID: <875@haddock.ISC.COM> Date: Wed, 5-Aug-87 17:59:12 EDT Article-I.D.: haddock.875 Posted: Wed Aug 5 17:59:12 1987 Date-Received: Sat, 8-Aug-87 06:22:28 EDT References: <22@flmis06.ATT.COM> <28700015@ccvaxa> <420@sugar.UUCP> <548@whuxm.UUCP> <450@sugar.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 19 In article <450@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >> getenv() and putenv() access an external variable "environ". >So... who sets up "environ". ... It must be the 'C' runtime. Right. In UNIX, it's the startup code in crt0.o. >If so, is there any good reason something similar can't be set up for "argv"? I'd prefer making just argv[0] global via "char *thisprogname" or something. Accessing the whole list could be dangerous, and argv[0] is the only one that's likely to be of interest to library routines. No, there's no good reason this can't be done. >Maybe in ANSI 'C'? No, their primary charter is to codify existing practice, which this isn't. Ask your vendor for the feature. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint