Subject: Re: We need a clone() or rfork().
To: Todd Vierling <>
From: Jason Thorpe <>
List: tech-kern
Date: 04/15/1999 11:59:14
On Thu, 15 Apr 1999 13:07:22 -0400 (EDT) 
 Todd Vierling <> wrote:

 > I remember Jason Thorpe speaking a while back about having the VM mechanisms
 > available to do an implementation of clone() or rfork() (not necessarily
 > threading, but `splitting a process').

Can you tell me precisely what Wine needs?  I.e. what clone()/rfork()
flags does it use?

Note, the OpenBSD rfork() doesn't actually share the address space, but
rather uses sharing maps ... sharing maps don't exist in UVM.  Also,
the original rfork() API specifies that RFMEM _does not actually share
the address space_, but only shares text/data (i.e. stack, heap, etc.
are apparently NOT shared).  So, calling the new call rfork() seems rather
lame, to me.

I'd rather implement it as clone(2) to be quite honest, although I do
despise the name :-)

This isn't too hard, but it's not going to be in 1.4.

 > As it turns out, Wine (which I pretty much need for work... <sigh>) now
 > requires some sort of syscall in the kernel to do this sort of work,
 > otherwise the real preemptive multitasking of Win32 doesn't work, and hence
 > Wine can only run Win16 apps.  It doesn't use pthread et. al. because it
 > needs some low level control (over things like the LDT).
 > Now, O*BSD implemented rfork() over Mach VM, so certainly this shouldn't be
 > impossible on UVM?

        -- Jason R. Thorpe <>