The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
c programming in linux convenientstore High Level Programming 6 04-07-2008 03:30 PM
Linux Programming in JAvA srikumar_cs UNIX for Dummies Questions & Answers 1 06-18-2007 05:40 PM
Need Help Of Linux Programming luckyvishwa Linux 1 01-01-2007 06:47 AM
Programming C in Linux wizkid High Level Programming 2 05-21-2001 08:55 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2009
venkatgopu venkatgopu is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
Post Linux programming

Hi friends!

I am new be in Linux system programing. Can you help me to get running processes statistics (pid, uid, %cpu, %mem, pri, ni) without using any commands like TOP, PS.

Can you tell me any system call available to get %cpu only or %mem only?
Even i include the vmstat.c file to achieve memory statistics by calling those function within vmstat.c file.When i compile my application program it shows an error that No such file or Directory

My requirement is that i want to achieve running processes statistics from my application program. When i compile my application program, the program must give the result like TOP command.

  #2 (permalink)  
Old 09-11-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,748
Start by learning about the /proc filesystem. It has process information.
proc(5): process info pseudo-filesystem - Linux man page See /proc/[number]/stat particularly

This sounds like homework. The forums do not allow homework
  #3 (permalink)  
Old 09-14-2009
venkatgopu venkatgopu is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
Hi jim mcnamara!

The above link you had given to me, Its very nice link to start my system programming. Thank you very much.

Thanks & Regards
Venkat Gopu
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0