filedesc copying in fork()

John Baldwin jhb at
Mon Oct 2 10:23:58 PDT 2006

On Sunday 01 October 2006 12:35, Divacky Roman wrote:
> hi
> I am trying to implement CLONE_FS in linuxolator clone(). This flags
> is used when we want the newly created thread share root/cwd/umask.
> In FreeBSD we have a flags to fork1() RFFDG/RFCFDG. The first one
> tells fork1() to copy the filedesc from old proc to the new one.
> The later says we should create new filedesc struct. If neither
> of these is given the filedesc struct is shared among the processes.
> is my analysis correct? 

I believe so.

> currently in the linuxolator we dont set any of this flags passed to
> fork1() ie. doing CLONE_FS semantics on default.
> I am a little confused from linux behaviour because it seems to me
> that they dont share open file descriptors betweeen processes after
> fork() which is strange.

I have no idea on this one.

John Baldwin

More information about the freebsd-emulation mailing list