Question: The function you implement will display the pid, total CPU ( user + system ) , and command name for all processes owned by the
The function you implement will display the pid, total CPU user system and command name for all processes owned by the user running the program. To find processes owned by the user, you should check out the loginuid file in procpid that contains the user info. The getuid syscall can be used to determine the uid of the user running the program.
You can get CPU usage information from the procpidstat file. Review the procStat structure from the homeworkHelpers.h file and the associate information from the proc man page to learn how to process this. And pay attention to the units that this information is provided in
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
