LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Getting PID's in C

[ILUG] Getting PID's in C

Caolan McNamara cmc at stardivision.de
Fri Apr 14 14:58:25 IST 2000


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 14.04.00, 15:44:54, "Vinayak Risbud" <vinayak_risbud at asiansonly.net> 
wrote regarding [ILUG] Getting PID's in C:


> Hi Friends

> How can I get the PID's of all the processes currently running
> in Linux Machine, using 'C'.

While you said Linux in particular you should be aware that this differs 
considerably from platform to platform as how to do this...

Unix programming faq is a good place to start for this sort of queries
http://www.whitefang.com/unix/faq_2.html#SEC17

There is a gnome library 
http://www.gnome.org/applist/view.phtml?name=LibGTop
Which is an attempt to be a cross platform interface for this sort of 
issue.

I would recommend one of those two approaches, If that still does not 
appeal to you then you can look at the /proc file system. A simple ls 
shows you all the running processes, each dir is a process. Check out the 
source to numerous programs for exact parsing details. Again libgtop is 
probably a good place to start.

C.

> Vinayak



> ------------------------------------------------------------
> Do you have YOUR free e-mail address? Get it now! http://asiansonly.net
> Free web sites... discussion forums... more! Click here -> 
http://asiansinc.com

> --
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription 
information.
> List maintainer: listmaster at linux.ie




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell