in reply to what is the method to get the environment from child process ?
This looks like an XY Problem.
Give us some context of the real problem you are trying to solve and what alternatives you have considered.