Xref: utzoo comp.lang.c:17895 comp.unix.wizards:15736 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!vsedev!logan From: logan@vsedev.VSE.COM (James Logan III) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: modifying parent's environment, etc. Message-ID: <1495@vsedev.VSE.COM> Date: 25 Apr 89 12:39:20 GMT References: <2158@pur-phy> <1030@quintus.UUCP> Reply-To: logan@vsedev.VSE.COM (James Logan III) Followup-To: comp.unix.wizards Organization: VSE Software Development Lab Lines: 29 [Note that followups have been redirected to to comp.unix.wizards] In article <1030@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: # In article <2158@pur-phy> sho@newton.physics.purdue.edu.UUCP (Sho Kuwamoto) writes: # >This thread got me to thinking. I wrote a quickie program which, # >for reasons I don't need to go into now, modified argv[i]. The # >strangest thing happened: if you run it in the background and look # >at it using ps, the line where it tells you what you typed in as # >your command line changes. # # Why do you think that is strange? ps gets the information about the # arguments of process #1234 by peeking into the address space of process # #1234 to find out what argv[] looks like. Under System V the arguments are stored in the character array u_psargs[PSARGSZ] in the u structure. The u structure is usually read directly from the swap device based on addresses found in the process table. # Note that you don't see I/O redirection, only the strings in argv[]. The I/O redirection symbols are taken care of by the shell and stripped off before the command sees it. -Jim -- Jim Logan logan@vsedev.vse.com VSE Software Development Lab uucp: ..!uunet!vsedev!logan (703) 329-4654 inet: logan%vsedev.vse.com@uunet.uu.net