home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8165 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.4 KB

  1. Path: sparky!uunet!shady!kevin
  2. From: kevin@shady.UUCP (Kevin Smith)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: Changing name associated with a process
  5. Summary: ps -f
  6. Message-ID: <22@shady.UUCP>
  7. Date: 25 Jul 92 04:11:20 GMT
  8. References: <mwarren.711724488@rws1> <mwarren.711816903@rws1>
  9. Reply-To: uunet!shady!kevin
  10. Organization: ShadeTree Software, Inc.
  11. Lines: 28
  12.  
  13. In article <mwarren.711816903@rws1> mwarren@rws1.ma30.bull.com (Mark Warren) writes:
  14. :>A few people replied to me, and the answer is even easier than BSD.
  15. :>The following program does exactly what it appears to do:
  16. :>
  17. :>main(ac, av)
  18. :>int     ac;
  19. :>char     *av[];
  20. :>{
  21. :>    av[0] = "new name";
  22. :>    sleep(60);
  23. :>}
  24.  
  25. Since UNIX SYS-3 a plain 'ps' will report the basename of the command as
  26. stored in the kernel proc structure.  Setting av[0] will not help this.
  27.  
  28. The system does not save the command's arguments as part of the internal
  29. proc structure.  Therefore, 'ps -f', examines the actual process memory
  30. image and attempts to parse the argv[] array to display the full argument
  31. list.  'ps -f' faithfully follows your new av[0] pointer.
  32.  
  33. The crypt command has always scribbled on it's av[] to obscure the key if
  34. it was passed as an arg.  Versions of uucico have been known to change
  35. their names to UUCICO.
  36. -- 
  37.         | Email - !shady!kevin uunet!shady!kevin
  38. Kevin Smith | Voice - (908) 874-7980
  39.         | Mail  - ShadeTree Software, Inc., 192 Capricorn Dr. #10,
  40.         |         Somerville, NJ  08876
  41.