From owner-freebsd-hackers Thu Jun 5 15:02:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA09733 for hackers-outgoing; Thu, 5 Jun 1997 15:02:50 -0700 (PDT) Received: from ki1.chemie.fu-berlin.de (ki1.chemie.fu-berlin.de [160.45.24.21]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id PAA09728 for ; Thu, 5 Jun 1997 15:02:46 -0700 (PDT) Received: by ki1.chemie.fu-berlin.de (Smail3.1.28.1) from mail.hanse.de (193.174.9.9) with smtp id ; Fri, 6 Jun 97 00:02 MEST Received: from wavehh.UUCP by mail.hanse.de with UUCP for freebsd-hackers@freebsd.org id ; Fri, 6 Jun 97 00:02 MET DST Received: by wavehh.hanse.de (4.1/SMI-4.1) id AA07428; Thu, 5 Jun 97 15:57:25 +0200 Date: Thu, 5 Jun 97 15:57:25 +0200 From: cracauer@wavehh.hanse.de (Martin Cracauer) Message-Id: <9706051357.AA07428@wavehh.hanse.de> To: borjam@we.lc.ehu.ES Cc: freebsd-hackers@freebsd.org Subject: Re: Linux clone() system call Newsgroups: hanse-ml.freebsd.hackers References: <9706041530.AA02422@sirius.we.lc.ehu.es> Reply-To: cracauer@wavehh.hanse.de Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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