public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-26371-131-tlBvalzPaD@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26371-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26371

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #13 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(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:
> 
> 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
> 
> 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, and 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 follow 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-07-03 18:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 10:24 [Bug libc/26371] New: " mztyvop at 0pointer dot net
2020-08-12 13:35 ` [Bug libc/26371] " christian.brauner at ubuntu dot com
2020-08-25 12:39 ` fweimer at redhat dot com
2020-08-25 12:46 ` christian.brauner at ubuntu dot com
2020-08-25 14:57 ` mztyvop at 0pointer dot net
2020-08-25 15:07 ` mztyvop at 0pointer dot net
2020-08-25 15:12 ` mztyvop at 0pointer dot net
2020-09-21 11:38 ` fweimer at redhat dot com
2020-09-21 12:37 ` mztyvop at 0pointer dot net
2020-09-22  9:45 ` fweimer at redhat dot com
2021-06-29 22:40 ` crrodriguez at opensuse dot org
2023-06-01 12:53 ` bluca at debian dot org
2023-06-01 13:24 ` bluca at debian dot org
2023-06-01 18:46 ` carlos at redhat dot com
2023-06-02  0:58 ` sam at gentoo dot org
2023-06-26 11:48 ` bluca at debian dot org
2023-07-03 18:52 ` adhemerval.zanella at linaro dot org [this message]
2023-07-03 19:32 ` bluca at debian dot org
2023-09-05 16:11 ` adhemerval.zanella at linaro dot org
2023-09-05 16:20 ` bluca at debian dot org
2024-02-06 10:59 ` bluca at debian dot org
2024-02-06 12:38 ` adhemerval.zanella at linaro dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26371-131-tlBvalzPaD@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).