From nobody Fri Jul 07 20:45:53 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 4QyQv60M3Lz4lybc for ; Fri, 7 Jul 2023 21:06:58 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4QyQv51k7Bz47tW for ; Fri, 7 Jul 2023 21:06:57 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 198.144.192.42 is neither permitted nor denied by domain of yuri@FreeBSD.org) smtp.mailfrom=yuri@FreeBSD.org; dmarc=none Received: from [192.168.5.3] (c-73-202-23-161.hsd1.ca.comcast.net [73.202.23.161]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 367KjsoP041582 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 7 Jul 2023 13:45:54 -0700 (PDT) (envelope-from yuri@FreeBSD.org) X-Authentication-Warning: shell1.rawbw.com: Host c-73-202-23-161.hsd1.ca.comcast.net [73.202.23.161] claimed to be [192.168.5.3] Message-ID: <693faa01-ca5e-a71c-4e5c-aea4f505ce54@tsoft.com> Date: Fri, 7 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: Freebsd hackers list From: Yuri Subject: What is the equivalent of the linux system call clone() on FreeBSD? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [2.20 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.30)[-0.298]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[yuri]; ARC_NA(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; HAS_XAW(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/19, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; GREYLIST(0.00)[pass,body] X-Rspamd-Queue-Id: 4QyQv51k7Bz47tW X-Spamd-Bar: ++ X-ThisMailContainsUnwantedMimeParts: N 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? Thanks, Yuri