public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] Query: Adding support for clone3()
Date: Fri, 28 Feb 2020 09:58:59 +0100	[thread overview]
Message-ID: <20200228085859.GA31181@rei> (raw)
In-Reply-To: <CAKohponuu3zpsQCv0v1_Yqb_tmqy5yyUejMoS1_M_UFf5FU2Mw@mail.gmail.com>

Hi!
> I was looking to start implementation of clone3() syscall in LTP
> and am a bit confused here and need your help in doing the same.
> 
> LTP abstracts the call to clone() syscall in lib/cloner.c and the current
> prototype of it looks like this.
> 
>        int clone(int (*fn)(void *), void *stack, int flags, void *arg, ...
>                  /* pid_t *parent_tid, void *tls, pid_t *child_tid */ );

This function is there mostly for implementation of container testscases
so that they does not need to deal with the clone() syscall complexity.

> One of the challenges with the implementation of clone3() is that
> there is no glibc wrapper available. And in case of clone() glibc
> wrapper isn't ordinary as it takes care of calling fn() and handling
> few stack related things, apart from calling the real syscall.
> 
> I am confused now on how should I write support for clone3().
> 
> Any suggestions will be appreciated. Thanks.

Let's just add the code into lapi/clone.h, would that work for you?

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2020-02-28  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  8:14 [LTP] Query: Adding support for clone3() Viresh Kumar
2020-02-28  8:58 ` Cyril Hrubis [this message]
2020-02-28 10:24   ` Viresh Kumar
2020-02-28 11:48     ` Cyril Hrubis
2020-03-04  7:45       ` Viresh Kumar

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=20200228085859.GA31181@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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