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 /proc/[pid] 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 /proc/[pid]/stat file. Review the procStat structure from the homework03Helpers.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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!