modifying parent's environment, etc.

James Logan III logan at vsedev.VSE.COM
Tue Apr 25 22:39:20 AEST 1989


[Note that followups have been redirected to to comp.unix.wizards]

In article <1030 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
# In article <2158 at pur-phy> sho at 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 at vsedev.vse.com
VSE Software Development Lab        uucp:  ..!uunet!vsedev!logan
(703) 329-4654                      inet:  logan%vsedev.vse.com at uunet.uu.net



More information about the Comp.unix.wizards mailing list