From nobody Fri Jul 07 21:31:59 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QyRS13yjZz4m5M6 for ; Fri, 7 Jul 2023 21:32:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QyRS13R7fz4KDP; Fri, 7 Jul 2023 21:32:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id Hn2fqTuJCLAoIHt3Zq5p6B; Fri, 07 Jul 2023 21:32:01 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id Ht3XqlrTf3fOSHt3Yqip6Z; Fri, 07 Jul 2023 21:32:01 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=64a88451 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=1iAygoCLSLMiyICj:21 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=GLwY3u6AAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=SzGwXmrm7qdw6aBcXBkA:9 a=CjuIK1q_8ugA:10 a=aH_FkMqe1q5rCaEqSjHH:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Kgq7MUCeuSZxtnmdROSF:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9C0222172; Fri, 7 Jul 2023 14:31:59 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 94845291; Fri, 7 Jul 2023 14:31:59 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Yuri cc: Freebsd hackers list Subject: Re: What is the equivalent of the linux system call clone() on FreeBSD? In-reply-to: <693faa01-ca5e-a71c-4e5c-aea4f505ce54@tsoft.com> References: <693faa01-ca5e-a71c-4e5c-aea4f505ce54@tsoft.com> Comments: In-reply-to Yuri message dated "Fri, 07 Jul 2023 13:45:53 -0700." List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 07 Jul 2023 14:31:59 -0700 Message-Id: <20230707213159.94845291@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEQWIbLWyxvkGaP7v9gymLMQssspBAqHlG+QHGryoGIr19Ti6diU72iQQLmEG0QF4kkIpyt74HAd0ohZQIXGQ5s0QwEhRrfQiEWl+0k/K1S4s16SzxOt 785cD8IzKhq6IoNw4cstaAEY+vTeOUYvFFwcePTpTWUmeXgYm29QpZH2TserluYkAzk77XmpU095mNQfgXRp+zXC0L1wazHUcS+bUECbj7Cb9XyApI+LY0pL 1TJzD14lgF09M4wOx2pf7Q== X-Rspamd-Queue-Id: 4QyRS13R7fz4KDP X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <693faa01-ca5e-a71c-4e5c-aea4f505ce54@tsoft.com>, Yuri writes: > Linux has the clone() function that allows the caller more control over > process cloning than the fork(2) function does. > > FreeBSD only has clone() in its Linux emulator code for Linux apps, but > it seems to be missing in the system. > > Is there a library that implements functionality similar to Linux's clone()? > > Otherwise, how can clone() calls like this > https://github.com/cea-hpc/wi4mpi/blob/master/src/common/helper.c#L82 be > resolved on FreeBSD? Linux replaced fork() and pthread_create() with clone(). > > > Thanks, > > Yuri > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0