[LTP] [PATCH] Update clone3 wrapper signature

Li Wang liwang@redhat.com
Wed Dec 17 10:43:34 CET 2025


On Wed, Dec 17, 2025 at 3:58 PM Anrea Cervesato via ltp <ltp@lists.linux.it>
wrote:

> Hi Chris,
>
> On 12/16/25 6:50 PM, Chris Wailes wrote:
> > Andrea,
> >
> > Thanks for reviewing the change.  We're currently adding a `clone3`
> > wrapper to Android's BIONIC libc implementation. Additionally, this is
> > the signature used for `glibc`'s `__clone3`
> > <
> https://github.com/bminor/glibc/blob/ded9c1e525f2d69a81e61c34c29077fed7df658c/include/clone_internal.h
> >.
> >
> > - Chris
>
> At this point, I think we should just adopt tst_clone() instead of
> clone3() fallback.
>

Perhaps a simple approach is to define a raw system call for clone3
and use it in all existing tests, and then add new tests if we plan to
test the libc-like clone3 wrapper (with four args).

Otherwise the new added 'NULL, NULL' arguments for current hacked
clone3 makes no sense.

static inline int ltp_clone3_raw(struct clone_args *args, size_t size)
{
    return tst_syscall(__NR_clone3, args, size);
}

#ifdef HAVE_CLONE3_WRAPPER
int ltp_clone3(struct clone_args *cl_args, size_t size,
               int (*fn)(void *), void *arg);
#else
static inline int ltp_clone3(struct clone_args *cl_args, size_t size,
                            int (*fn)(void *), void *arg)
{
    return -1;
}
#endif

Btw, the above changes should be put in lapi/sched.h if we decide go this.


-- 
Regards,
Li Wang


More information about the ltp mailing list