Wanted Dead or Alive: A ps that displays all command args...

Mike "Ford" Ditto ford at elgar.UUCP
Thu Jun 23 04:02:03 AEST 1988


In article <398 at icus.UUCP> lenny at icus.UUCP (Lenny Tropiano) writes:
>Ok.  I was wrong ... It can be done.  For some reason AT&T took a short-cut
>and only displayed the u_comm string in the user block that only contains
>the first argument.  The real way of doing it and really the "-f"
>option of the ps(1) should do this.  But as usual...

THe shortcut on the Unix PC is in the exec function, which doesn't
store the full args.  On a normal system V (at least in release 2)
there is a field in the user area (called u_psargs) reserved for
storing the first 40-or-so characters of the exec arguments.  This is
what ps normally prints, but for some reason, the Unix PC doesn't have
this field, so ps prints u.u_comm (which is NOT argv[0], but the
"path" argument to exec - the name of the file being run).

>A few people mentioned the way of doing it is to look up the user's stack
>space in memory and read back the arguments from the "argv-block".

This is the way ps worked in version 7, and probably still does in BSD.


					-=] Ford [=-

"Once there were parking lots,		(In Real Life:  Mike Ditto)
now it's a peaceful oasis.		ford at kenobi.cts.com
This was a Pizza Hut,			...!sdcsvax!crash!kenobi!ford
now it's all covered with daisies." -- Talking Heads



More information about the Unix-pc.general mailing list