![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identifying and grouping OS processes and APP processes | wilsonee | SUN Solaris | 2 | 09-30-2008 06:26 AM |
| du from list with du of list total | Movomito | Shell Programming and Scripting | 3 | 05-04-2008 06:33 PM |
| Monitoring Processes - Killing hung processes | ukndoit | UNIX for Advanced & Expert Users | 4 | 01-17-2008 01:30 AM |
| how to generate a random list from a given list | mskcc | Shell Programming and Scripting | 3 | 05-30-2006 12:30 AM |
| Comparing a distinct value in 1 list with another list | manualvin | Shell Programming and Scripting | 6 | 06-22-2004 03:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to get list of processes
Hi,
How can I get a list of all the running processes, in C? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Short answer, depends on platform and a bunch of other things.
The full, unadorned ugly truth is the source for ps(1) for your computer. Linux: procps - Home Page FreeBSD (some version): http://ftp.nl.freebsd.org/os/FreeBSD.../bin/ps/ps.c,v (sorry, that's the raw CVS file, but you can cope) |
|
#3
|
|||
|
|||
|
really? no cross-unix way to do it? I thought it was pretty fundamental...
Thanx anyway. |
|
#4
|
|||
|
|||
|
Linux is not Unix. I guess the kvm_* stuff in BSD is pretty much portable to other "real" Unices.
|
|
#5
|
|||
|
|||
|
You can use the popen function to get the output of the ps command.
Regards |
|
#6
|
|||
|
|||
|
era,
whats "kvm_*" stuff? |
|
#7
|
|||
|
|||
|
Hmm, you didn't look at the code? It's the FreeBSD link up there; click click.
|
|||
| Google The UNIX and Linux Forums |