From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2B0093858022; Mon, 3 Jul 2023 18:52:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B0093858022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688410325; bh=w0xHcVEdC5BE7YJag+hpYekpa5a+hd0loif3oj+ekcI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vQISoGCHSCzrTNxDOFGUgobFAsW/xI1zxFaJYiknUB0l3tX1dk7IMjXUjRJ03IMGh 6Et8M72iAlcidTB43wL1NPwF4lOHsvEde83fE/nn0YhoEnpeuUj7qCksJOWVEvFQpv GcWx+mllWQ3SicRkAMwPDOqG+p/7RXs+pazN4Gxs= From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/26371] [RFE] please add clone3() wrapper (in particular the CLONE_INTO_CGROUP feature of it) Date: Mon, 03 Jul 2023 18:52:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D26371 Adhemerval Zanella changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adhemerval.zanella at lina= ro dot o | |rg --- Comment #13 from Adhemerval Zanella --- (In reply to Luca Boccassi from comment #12) > In systemd we are also interested in posix_spawn, but there's 3 features > we'd need added: >=20 > 1) spawn-by-fd version that takes file descriptor instead of path > 2) CLONE_INTO_CGROUP support > 3) support for returning PID FD instead/together with PID >=20 > Is this something that would be possible to implement? Thanks! I have been working on extending fork and posix_spawn to support PIDFD (BZ 30349) and I think these interfaces might be the way to provide CLONE_INTO_CGROUP and/or any clone3 extension. These are Linux-specific and provide wrapper over clone calls. I added pidfd_fork in a way it can be a superset of both fork and _Fork, an= d it should be simple to extend to get a new argument: if this has a non-negative value it will pass CLONE_INTO_CGROUP along with the group file descriptor. = Now that clone3 is an extensible interface, I wonder if glibc should also follo= w a similar approach (mainly to avoid the need to keep adding versioned symbols= for any additional new clone3 support). posix_spawn accomplishes it by using a posix_spawnattr_t along with init/destroy interface and glibc implementation adds some slack space for possible extensions. Maybe we can add similar support for pidfd_fork, so instead of named arguments, it uses a sized struct with input/output values. --=20 You are receiving this mail because: You are on the CC list for the bug.=