Question: System Call in C Programming Linux Kernel Implement a system call print_other to print the information for an arbitrary process. The system call takes a

System Call in C Programming Linux Kernel

Implement a system call print_other to print the information for an arbitrary process. The system call takes a process pid as its argument and outputs the following information of this process:

Process id, running state, and program name

Start time and virtual runtime

Its parent processes until init

HINT: The macro current returns a pointer to the task_struct of the current running process. See the following link for more information: http://linuxgazette.net/133/saha.html

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.

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 Databases Questions!