Re: Printing environment variables for a process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Manish,


But since parents environment variables are copied into childs address
space, I was expecting do_fork to copy some environment related field
too of task_struct.

I cannot speak  with autrhority on this.  However here is my thought...
What fork()->do_fork()  does it duplicates address space of a process.
Means the environment variable are inhereited from shell (global) and
never travels to kernel space.

Also If I am not wrong this behaviour is also
governed by whether you have passed CLONE_VM flag to do_fork or not.
So there must be something which checks this flag and does the copy.

What i know is CLONE_VM flag is set on vfork() call only.
It does not determine executing process environment 
vairable behaviour.

Thanks

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux