Re: chdir for cloned tasks?

Bill Hawes (whawes@star.net)
Sun, 10 Aug 1997 16:18:10 -0400


Ingo Molnar wrote:
>
> On Sat, 9 Aug 1997, Bill Hawes wrote:
>
> > How is a chdir for a cloned task supposed to be handled? The current
> > code looks like it would change directories for all of the clones.
> >
> > Shouldn't the current directory and root be treated as a "copy on write"
> > data structure?
>
> the CLONE_FS flag to clone() handles this. If you clone such a thread, it
> will still share full VM with other threads, so no speed penalty.

I understand what the CLONE_FS flag does -- my question was whether such
a cloned task, when it makes a system call to sys_chdir, should get a
private copy. The present sys_chdir code doesn't check whether the task
is a clone or not, so one clone changing directory would change it for
all clones.

Is this the intended behavior?

Regards,
Bill