|
|
SunOS 5.8 -- getting process info using it's pid in C/C++
Hi,
I am looking for a bit of help with Solaris with porting one of the
app. That app among other things needs to find few things about parent
and grandparent process:
- command line used to start it (I am not sure if it is possible for
process to change that -- it is another question... But if possible I
definitely need original cmd line). I tried to use /usr/bin/ps, but it
truncates cmd line to 80 symbols
- process's cwd (which could be taken from /proc/pid/cwd, I assume)
- path to the binary that was used to start that process (i.e.
equivalent of /proc/pid/exe link available in Linux)
How can I get this info? Is it possible to link some lib or I am
doomed using system/pipe calls to invoke some utility and then parsing
it's output?
Thank you!.
Sincerely yours,
Michael.
|
|
0
|
|
|
|
Reply
|
crusader.mike (6)
|
10/22/2009 12:24:47 AM |
|
On Oct 21, 8:24=A0pm, Michael Kilburn <crusader.m...@gmail.com> wrote:
> Hi,
>
> I am looking for a bit of help with Solaris with porting one of the
> app. That app among other things needs to find few things about parent
> and grandparent process:
> - command line used to start it (I am not sure if it is possible for
> process to change that -- it is another question... But if possible I
> definitely need original cmd line). I tried to use /usr/bin/ps, but it
> truncates cmd line to 80 symbols
> - process's cwd (which could be taken from /proc/pid/cwd, I assume)
> - path to the binary that was used to start that process (i.e.
> equivalent of /proc/pid/exe link available in Linux)
>
> How can I get this info? Is it possible to link some lib or I am
> doomed using system/pipe calls to invoke some utility and then parsing
> it's output?
>
> Thank you!.
>
> Sincerely yours,
> Michael.
The command "pargs" works great. However, that command first showed
up in Solaris 9 so that might not be an option for you. You might
want to try "/usr/ucb/ps -auxwwww". For me, "pargs -l" on Solaris 9
or greater works great.
Juan
|
|
0
|
|
|
|
Reply
|
webjuan
|
10/22/2009 2:14:51 AM
|
|
|
1 Replies
266 Views
(page loaded in 0.048 seconds)
Similiar Articles: How to get tcp port numbers on Solaris 8/9 - comp.unix.solaris ...I tried using netstat, but I cannot grep for pid or process name ... confirmed using tcp view 1.11 by sysinternals. However pfiles gives different results: SunOS 5.9 # ps ... stat function limit for files over 2GB ? - comp.unix.programmer ...stat fails on SunOS 5.8 for a 4GB file - comp.unix.solaris ... Limit on ftp file sizes ... Is it reasonable to read the /proc/<pid>/stat file and take ... stack size ... Change process/command name? - comp.unix.solaris... First, lets choose one process, with its Process info Address: :)# ps -efo pid ... existing process? - comp.unix.solaris I have process that is ... SunOS <machine-name> 5 ... OpenSSH and .rhosts usage - comp.unix.solaris... has been authenticated by privileged process ... SIGCHLD. debug1: session_by_pid: pid 4023 ... channel 0: close_fds r -1 w -1 e -1 c -1 Sun Microsystems Inc. SunOS 5.8 ... Can we get 64 bit process' memory info with application running in ...Hi, We've a module that fetches the process information of specific process on Sun ... of zombie lwps in the process */ pid_t pr_pid; /* process id ... Strange problem with CPU spikes on solaris 8 - comp.unix.solaris ...... machine (with 2 processors) and solaris 8. (SunOS ficus 5.8 Gene... ... % ---- 1.00 1309 cpu[0] pid ... 5 - 2% cpu, but during spikes the cpu for the process ... What is lwp_park w/ ETIME error and ... - comp.unix.solaris ...When I run truss -c -p process, I have the following: faults ----- FLTBOUNDS 246 total: 246 signals ----- SIGSEGV ... No more memory available - comp.soft-sys.math.mathematica ...... the program so after some amount of >> push, pop all which was pushed and process ... Available RAM on SunOS 5.10 - comp.unix.solaris As you need more memory, the system ... comp.unix.programmer - page 32invoke gnuplot from C 0 207 (8/25/2003 5:09:34 AM) Hi, I use fork()+pty+exec() to invoke "gnuplot" and in child process, I ... out? does the proc/[PID]/fd list all open fd's ... Hox to match Linux PID to tomcat thread - comp.lang.java ...By using top you have the process ID of the process that contains multiple threads for Tomcat. If you kill that process all the threads go away. Topping top in Solaris 8 with prstatsar -g 5 5. SunOS tartan 5.8 Generic_108528-01 ... prstat -m -p 3295 PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/NLWP 3295 kincaid 0.8 0.0 ... Controlling System Processes in SolarisYou can use this ID to determine the state of a specific process. PPID— The parent process ID. C— Processor utilization. PRI— The set scheduling parameters for a ... 7/23/2012 4:46:35 PM
|
|
|
|
|
|
|
|
|