how can we get system information using c functions in any form of linux
I need to obtain information such as CPU,Mem utilization and statistics like type and brand of cpu ,number of nics connected to the system,nics type its mac address ,partitions/disk capacity,device idand its type ATA/SATA.I would like to know whether any pci cards are connected to my machine ....if yes its information. swap memory statistics .I would also like to know how to get events which occured ..is there any log file from which i can parse the events details.
Where can i get the above information from ,I dont wanna use the commands at the command prompt to get the information as this might slow my system down .I want to know if there is any directory which contains this information, like the /proc/cpu info file in ubuntu for cpu information etc .
Can u please help me out how to get the cpu and memory utilization for each and every process which is running on my machine.
i have to use some system calls or c functions inorder to do this .....can n e body help me out this ....i was able to find ioctl which would return ip address and mac address....can i use the same function to get information for all the above stated parameters.
thanks in advance