Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Destroying arguments Message-ID: <6723@mimsy.UUCP> Date: Sun, 17-May-87 18:23:05 EDT Article-I.D.: mimsy.6723 Posted: Sun May 17 18:23:05 1987 Date-Received: Sun, 17-May-87 22:41:41 EDT References: <292@osupyr.UUCP> <239@polyof.UUCP> <485@bene.UUCP> Distribution: comp.unix.questions Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <485@bene.UUCP> itkin@bene.UUCP (Steven List) writes: >... since argv is an array of POINTERS to strings, the simple thing >to do is to set up your own string and then store the address/pointer >in argv[n]. This avoids the potential pitfalls that John's method >involves and gives you the option to store ANYTHING YOU WANT in >the argument list. Alas, this wonderfully simple technique simply does not work with the 4BSD `ps', which reads the strings themselves, not the pointers thereto. An extremely long argv, or a long environment, *will* confuse ps; it is sometimes possible simply to store a valid pointer into argv[argc]. This is not, however, something I would rely upon. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris