Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 97 15:57:25 +0200
From:      cracauer@wavehh.hanse.de (Martin Cracauer)
To:        borjam@we.lc.ehu.ES
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Linux clone() system call
Message-ID:  <9706051357.AA07428@wavehh.hanse.de>
References:  <9706041530.AA02422@sirius.we.lc.ehu.es>

next in thread | previous in thread | raw e-mail | index | archive | help
borjam@we.lc.ehu.ES (Borja Marcos) wrote:

>	Anyone knows what is the clone() system call in Lunux?
>It seems not to be supported by the Linux emulator. I tried running
>the Linux version of Inferno and it died with something like
>"clone(): unimplemented system call".

FreeBSD's rfork() does most of clone(), both created new processes
where resources can be shared with the parent process, noticable
vortial memory. Can be used kernel-sheduled threads, SMP-capable. This
has nothing to do with kernel threads, BTW, at least not for my usage
of these terms.

The Linux folks implement a Posix thread API on top of clone.

To reach real Posix Threads API compatiblity with threads implemented
this way - as processes with shared resources, you need some serious
extensions to the process model. For example. Posix requires that all
threads of a process share one userid ,which isn't the case for plain
rfork'ed or clone'd processes.

When I least looked, the Linux folks planned to add a flag to clone()
to share PIDs with the parent (if I'm not mistaken, a process ID will
then become a two-piece thing, process and subprocess id). Gessing
from source, this happend meantime.

This will make it quite hard to implement compatiblity with clone(),
unless we implement Posix threads API compatiblity the same way.

Also, programs that use clone() often use the process sheduling
functions of Linux as well, I don't know how much of them is
compatible with FreeBSD or implemented in the Linux emulator, but I
suspect that implementing clone() compatiblity is not enough to run
advanced thread-using Linux binaries on FreeBSD.

>	I did a "man clone" in a Linux box and it gave me
>the "undocumented calls" man page.

Linux kernel source, as of 2.0.29 the clone() flags with comments are
in include/linux/sched.h.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin_Cracauer@wavehh.hanse.de http://cracauer.cons.org  Fax.: +4940 5228536
"As far as I'm concerned,  if something is so complicated that you can't ex-
 plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9706051357.AA07428>