Subject: Re: We need a clone() or rfork().
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Todd Vierling <tv@pobox.com>
List: tech-kern
Date: 04/15/1999 16:39:19
On Thu, 15 Apr 1999, Jason Thorpe wrote:

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

From Wine's scheduler/sysdeps.c is the following block, which is the only
place clone() is called.  The rfork() support is ugly and FreeBSD-specific;
it's an inline asm calling the syscall directly.

#ifdef HAVE_CLONE_SYSCALL
    if (clone( (int (*)(void *))SYSDEPS_StartThread, thread->teb.stack_top,
               CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, thread ) < 0)
        return -1;
    /* FIXME: close the child socket in the parent process */
/*    close( thread->socket );*/
#endif

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

Lunix already has it ... sigh.  No matter which we use, we may need to
implement one in terms of the other anyway at some point in the name of
compatibility.

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

Yah, I understand.  I'll finally commit the updates to Wine and add a
pkg/MESSAGE saying `only Win16 apps on NetBSD 1.[34]' ... the Win32 support
for nonthreaded machines is ugly, now deprecated, and unstable at best
(completely nonfunctional on internally multithreaded apps).

At least the ball can start rolling.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)