Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP Newsgroups: comp.unix.questions Subject: Re: Destroying arguments Message-ID: <1717@ttrdc.UUCP> Date: Tue, 19-May-87 20:00:16 EDT Article-I.D.: ttrdc.1717 Posted: Tue May 19 20:00:16 1987 Date-Received: Fri, 22-May-87 01:02:45 EDT References: <292@osupyr.UUCP> <239@polyof.UUCP> <485@bene.UUCP> <6723@mimsy.UUCP> <19131@sun.uucp> Distribution: comp.unix.questions Organization: AT&T, Skokie, IL Lines: 52 In article <19131@sun.uucp>, guy%gorodish@Sun.COM (Guy Harris) writes: > The 3B2 version of "ps" does it > differently; the kernel stashes a string away in the U area that > contains the original arguments used to invoke the program. (I have > no idea whether this was done because somebody thought this was the > right way to do things, or because they couldn't figure out how to > snarf the arguments up on a machine whose stack grows upward in > memory....) On this machine, you *can't* smash your argument list. > Period. > The answer is "forget it". In general, it can't be done. This may well be true on some machines and implementations, but don't unjustly blacken the 3B2, please. I tried this code on a 3B2/400 running System V Release 2.0.4 swapping: main(argc,argv) int argc; char *argv[]; { int i; char *c; void perror(); for (i=0; i