[comp.unix.internals] How do I find programs complete run-string ?

kenc@ezelmo.UUCP (Ken Cornetet) (03/05/91)

Under system V, how does one find the complete runstring of another
process ?  By snooping around in the proc and user tables, I can find
the process argv[0], but I don't see any way to get the rest of the
args.  Also, if the proc table says a process is swapped, how do I map
the pointer to the user table to a disk address ?  Inquiring minds want
to know!


-- 
Ken Cornetet       (812) 634-2824   |                             
Rt. 5  Box 184A, Jasper, IN 47546   |   ...!uunet!coplex!nos850!ezelmo!kenc

jfh@rpp386.cactus.org (John F Haugh II) (03/05/91)

In article <199@ezelmo.UUCP> kenc@ezelmo.UUCP (Ken Cornetet) writes:
>Under system V, how does one find the complete runstring of another
>process ?  By snooping around in the proc and user tables, I can find
>the process argv[0], but I don't see any way to get the rest of the
>args.  Also, if the proc table says a process is swapped, how do I map
>the pointer to the user table to a disk address ?  Inquiring minds want
>to know!

It depends somewhat on the exact version of System V that you are
running since the memory management scam has a lot to do with how
you track down your processes pieces parts.

I posted a beta-test version of a kernel snooper a few weeks back
in alt.sources.  You might want to try dredging it up and using it
as the basis for your own kernel snooper if you don't already have
a "crash" utility.  Otherwise, drag out the system-supplied crash
and dig around the various kernel structures with a copy of "Bach"
at hand.
-- 
John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832 | GEnie PROHIBITED :-) |  Domain: jfh@rpp386.cactus.org
"I've never written a device driver, but I have written a device driver manual"
                -- Robert Hartman, IDE Corp.

scottl@convergent.com (Scott Lurndal) (03/09/91)

In article <510@bria>,  writes:
|> In an article, ezelmo.UUCP!kenc (Ken Cornetet) writes:
|> >
|> >Under system V, how does one find the complete runstring of another
|> >process ?  By snooping around in the proc and user tables, I can find
|> >the process argv[0], but I don't see any way to get the rest of the
|> >args. 
|> 
|> Under SysV you want to look at u->u_psargs which will contain up to
|> PSARGSZ characters of the command line.
|>
Assuming of course that your operating system, which provides SysV semantics to 
applications and users, actually *has* a u-area (I know of at least 
two that don't have either a proc structure or a u area) (and don't
even have a /dev/kmem!)