Re: vfork & co bugfix

Linus Torvalds (torvalds@transmeta.com)
Sun, 10 Jan 1999 23:31:34 -0800 (PST)


On 11 Jan 1999, Eric W. Biederman wrote:
>
> >> Question. Why don't we let CLONE_VFORK be a standard clone flag?
>
> LT> Because then we're back to the old problem: before doing a vfork(),
> LT> somebody could do a "clone(CLONE_VFORK)" (which would _not_ wait on the
> LT> semaphore like a real vfork() would), and now the wrong child can wake up
> LT> the parent and mess up the real vfork().
>
> Sorry. I had the implicit assumption that if CLONE_VFORK was a
> standard clone flag, do_fork would include the five lines of semaphore
> code.

Oh, ok.

Sure, makes sense, and is probably the right thing to do - that way you
can (if you really want to) do some strange half-way vfork(), half-way
clone() thing where you share your file descriptors in a vfork().

I don't know how useful it would be, but it would be no uglier than doing
it any other way, and I see some advantages (no need for a separate
vfork() system call - clone() can do it directly).

I thus remove all my objections,

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/