How do I get the argv[] if I know the process id?

I have process id, how do I get the argv[] of that process?
I didn't create that process and I don't know anything about it?
I'm usin C/C++.
tonitopAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
superschlonzConnect With a Mentor Commented:
try reading /proc/<pid>/cmdline
0
 
ahoffmannConnect With a Mentor Commented:
if your OS does not support /proc filesystem, check if it has kvm_*() procedures (like on Solaris)
0
 
jmcgOwnerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Splt: superschlonz {http:#6204588} & ahoffmann {http:#6242185}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.