[LTP] [PATCH v1] clone3: Add clone3's clone_args cgroup

Petr Vorel pvorel@suse.cz
Thu Mar 23 10:26:55 CET 2023


Hi Wei,

Do you plan to use this somewhere? Otherwise I don't see the point to just
add it.

Kind regards,
Petr

> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  include/lapi/sched.h | 3 +++
>  include/tst_clone.h  | 1 +
>  lib/tst_clone.c      | 1 +
>  3 files changed, 5 insertions(+)

> diff --git a/include/lapi/sched.h b/include/lapi/sched.h
> index 1065665d1..3ad16d136 100644
> --- a/include/lapi/sched.h
> +++ b/include/lapi/sched.h
> @@ -54,6 +54,9 @@ struct clone_args {
>  	uint64_t __attribute__((aligned(8))) stack;
>  	uint64_t __attribute__((aligned(8))) stack_size;
>  	uint64_t __attribute__((aligned(8))) tls;
> +	uint64_t __attribute__((aligned(8))) set_tid;
> +	uint64_t __attribute__((aligned(8))) set_tid_size;
> +	uint64_t __attribute__((aligned(8))) cgroup;
>  };

>  static inline int clone3(struct clone_args *args, size_t size)
> diff --git a/include/tst_clone.h b/include/tst_clone.h
> index 9ffdc68d1..7b278dfa7 100644
> --- a/include/tst_clone.h
> +++ b/include/tst_clone.h
> @@ -11,6 +11,7 @@
>  struct tst_clone_args {
>  	uint64_t flags;
>  	uint64_t exit_signal;
> +	uint64_t cgroup;
>  };

>  /* clone3 with fallbacks to clone when possible. Be aware that it
> diff --git a/lib/tst_clone.c b/lib/tst_clone.c
> index ecc84408c..2aa00beb1 100644
> --- a/lib/tst_clone.c
> +++ b/lib/tst_clone.c
> @@ -15,6 +15,7 @@ pid_t tst_clone(const struct tst_clone_args *tst_args)
>  	struct clone_args args = {
>  		.flags = tst_args->flags,
>  		.exit_signal = tst_args->exit_signal,
> +		.cgroup = tst_args->cgroup,
>  	};
>  	int flags;
>  	pid_t pid = -1;


More information about the ltp mailing list