| Author |
how to get process status
|
|
| Jaguk Ku 2004-01-23, 5:07 pm |
| Hi there,
I need to get process status, such as process memory usage, cpu usage in
unix programming
Machine : sun E450, solaris 8
Compiler : gcc
Thanks in advance
Jaguk Ku
| |
| David Schwartz 2004-01-23, 5:07 pm |
|
"Jaguk Ku" <jkku@kynax.com> wrote in message
news:br130q$45v$1@news1.kornet.net...quote:
> Hi there,
>
> I need to get process status, such as process memory usage, cpu usage in
> unix programming
>
> Machine : sun E450, solaris 8
> Compiler : gcc
>
> Thanks in advance
>
> Jaguk Ku
The 'ps' program is what you want.
DS
| |
| Jaguk Ku 2004-01-23, 5:07 pm |
|
"David Schwartz" <davids@webmaster.com> wrote in message
news:br1eni$6hg$1@nntp.webmaster.com...quote:
>
> "Jaguk Ku" <jkku@kynax.com> wrote in message
> news:br130q$45v$1@news1.kornet.net...
>
> The 'ps' program is what you want.
>
> DS
>
>
thanks for your reply
i need a function for my application rather than shell command
| |
| David Schwartz 2004-01-23, 5:07 pm |
|
"Jaguk Ku" <jkku@kynax.com> wrote in message
news:br1dj7$cv2$1@news1.kornet.net...
quote:
[QUOTE][color=darkred]
> thanks for your reply
> i need a function for my application rather than shell command
Then use 'popen' to launch the 'ps' program. Otherwise, get the source
code to 'ps' and modify/borrow it.
DS
| |
| Terry Sanders 2004-01-23, 5:07 pm |
| "David Schwartz" <davids@webmaster.com> wrote in message
news:br1hc2$841$1@nntp.webmaster.com...quote:
>
> "Jaguk Ku" <jkku@kynax.com> wrote in message
> news:br1dj7$cv2$1@news1.kornet.net...
>
>
>
> Then use 'popen' to launch the 'ps' program. Otherwise, get the source
> code to 'ps' and modify/borrow it.
>
Have a look in /usr/include/sys/proc.h or get the source for
utilities such as top or yamm and see how they do it.
|
|
|
|