Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Accessing argc & argv from a functi Message-ID: <853@mcgill-vision.UUCP> Date: Wed, 5-Aug-87 03:33:09 EDT Article-I.D.: mcgill-v.853 Posted: Wed Aug 5 03:33:09 1987 Date-Received: Sat, 15-Aug-87 08:17:47 EDT References: <22@flmis06.ATT.COM> <28700015@ccvaxa> Organization: McGill University, Montreal Lines: 25 In article <28700015@ccvaxa>, aglew@ccvaxa.UUCP quotes: >> How does one get at argc and argv from a function? and writes: > At McGill I modified crt0 to put argc/argv/envp into globals > Argc/Argv/Envp, as well as passing them to main(). [...]. der Mouse > Parker took this up and may still have it. Well, I took up the concept; I didn't see enough of Krazy Glew's code to steal, and I picked different names for the globals [of course :-(], argcnt and argvec (I figured "environ" was good enough for envp). > I have always thought that perror(str) was silly - sometimes I want > str to be the command name, sometimes the command plus all > arguments... I know what you mean. Well over half of all the calls to perror() I write look like perror((char *)0); because the prefix is more complicated than a single string, so I have fprintf(stderr,....); before the perror(). Wish perror() were printflike, perhaps like syslog() - syslog() accepts a printf format, except that %m means insert sys_errlst[errno]. der Mouse (mouse@mcgill-vision.uucp)