Question: Modify this system call to print the information for an arbitrary process. The system call takes a process pid (process id) as its argument and

Modify this system call to print the information for an arbitrary process. The system call takes a process pid (process id) as its argument and outputs the above information of this process.
HINT: You can start from the init process and iterate over all the processes. For each process, compare its pid with the target pid. If there is a match, return the pointer to this task_struct. A better approach is to use the pidhash table to look up the process in the process table. Linux provides many functions to find a task by its pid.
other useful methods:
1. for_each_process()
2. pid_task()
#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
