I want the /proc/PID/ directory of a process to be conserved for some time even after the exit of the program ,so that its "grand parent" can check out the resource usage from /proc/PID/stat. I can't use wait4() since I am concerned about the resource usage of "grand cild". So how can I conserve the /proc/PID/ directory?
NOTE : Copying the /proc/PID/stat just before exiting the program is not a solution in my context,since I need the total resource usage statistics of that process throughout its life time.