clinuxprocesslinux-kernel

Is /proc directory generated dynamically per request?


So I am supposed to achieve following behavior.

This project you are asked to add a new field to the task descriptor. The name and type of the field is: int casper;

I have already modified task_struct definition and its default value for init process and added necessary stuff to fork sys call

I did some research but couldnt find an obvious way to do this. So I assumed that /proc is created per request so I can get the task_struct of the process that requested it and populate the /proc according to that. Am I on the right track?


Solution

  • Yes, it is. /proc is a virtual filesystem generated by the kernel upon request. Check the following article for more details: Linux VFS