Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Program Linux Kernel: write system call for taking in pid (process ID) as user input and outputting the program name, running state, start time,

C Program Linux Kernel: write system call for taking in pid (process ID) as user input and outputting the program name, running state, start time, virtual runtime, and its parent processes until init.

* 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:

Running state, and program name Start time and virtual runtime Its parent processes until init

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions