?: argv not in the proc structure

?: argv not in the proc structure

Post by Richard Petti » Fri, 20 Nov 1998 04:00:00

Can someone send me a code snippet that shows how "ps" gets the entire
command line out of the kernel?  The closest I've come are the comments
in the execargs.h include file, but it's an incomplete explanation.

I know about getprocs and the procsinfo struct.  The pi_comm member
is insufficient.  I need the whole command line.

IBM support: RFE: put argc and argv in the proc structure.


+-                  -+-                            
-+-                     -+
|   Richard Pettit   |  Chief Performance Architect  |   4473 Willow
Road    |

200        |
|   (925) 737-4076   |       www.resolute.com        |  Pleasanton CA
94588  |
+-                  -+-                            
-+-                     -+


1. execve( argv[1], argv ) not work in method out of main ?

I just got a strange problem about calling and processing execve,the
following is the code

void test(char** argv);
int main (int argc,char ** argv)
    execve( argv[1], argv );  /*this work*/

    perror("no working in main\n");  
    return 0;

void test(char** argv)
{   execve( argv[1], argv );  /*this no work*/
    perror("no working in test-method\n");    

if calling execve in main, it worked as expected, but if remove it
from main and calling it in test() as the rest codes above, the output
from Sun Solaris 5.8 as:

no working in test-method
: Bad address
no working in main
: Bad address

Could any one point out to me?



2. HELP: Can only boot from floppy after Large IDE install...

3. Plug-ins not not seen by Gimp

4. undefined symbol in shared library problem

5. Is */argv[i] = argv[i + 1];/* safe?

6. How to deploy JSP/servlets for lots of users ?

7. printf("*++*argv=%d\t%c\n",c=*++*argv,c); [ c no change ]

8. Centronics Pageprinter 8 drivers?

9. HELP: csh-$argv[$#argv]-struct in bash???

10. $argv[$#argv]

11. /proc/<pid>/stat does not jive with proc(5) man page

12. Debugging using structured proc implementation

13. Parse /proc/xxx or are there direct kernel structures?