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.

:confused:

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

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