]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tree-wide: use struct clone_args directly
authorChristian Brauner <brauner@kernel.org>
Wed, 10 Aug 2022 10:03:54 +0000 (12:03 +0200)
committerChristian Brauner (Microsoft) <christian.brauner@ubuntu.com>
Wed, 10 Aug 2022 10:16:14 +0000 (12:16 +0200)
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
meson.build
src/lxc/process_utils.c
src/lxc/process_utils.h
src/lxc/start.c
src/lxc/start.h
src/tests/reboot.c

index d55808fb0142d11df491f10abf51f9048988548b..d10e82ab8ccad79cf794079496ecbd5c9f2a44b8 100644 (file)
@@ -583,7 +583,6 @@ decl_headers = '''
 #include <linux/fs.h>
 #include <linux/if_link.h>
 #include <linux/openat2.h>
-#include <linux/sched.h>
 #include <linux/types.h>
 '''
 
index 76e27da0fe63b96cd1abc719fee4ac12d47d1fa9..eb52736b62647713f73df6a70a1abd8438dce88f 100644 (file)
@@ -90,7 +90,7 @@ __returns_twice pid_t lxc_raw_legacy_clone(unsigned long flags, int *pidfd)
 __returns_twice pid_t lxc_raw_clone(unsigned long flags, int *pidfd)
 {
        pid_t pid;
-       struct lxc_clone_args args = {
+       struct clone_args args = {
                .flags          = flags,
                .pidfd          = ptr_to_u64(pidfd),
        };
index ed84741d0e459460075dc887fd281f0c79b3757f..d2bf97802d1f66316932edd560442768fe0c9ba4 100644 (file)
@@ -5,7 +5,6 @@
 
 #include "config.h"
 
-#include <linux/sched.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
 #define u64_to_ptr(x) ((void *)(uintptr_t)x)
 #endif
 
-struct lxc_clone_args {
+#if !HAVE_STRUCT_CLONE_ARGS
+struct clone_args {
        __aligned_u64 flags;
        __aligned_u64 pidfd;
        __aligned_u64 child_tid;
@@ -178,8 +178,9 @@ struct lxc_clone_args {
        __aligned_u64 set_tid_size;
        __aligned_u64 cgroup;
 };
+#endif
 
-__returns_twice static inline pid_t lxc_clone3(struct lxc_clone_args *args, size_t size)
+__returns_twice static inline pid_t lxc_clone3(struct clone_args *args, size_t size)
 {
        return syscall(__NR_clone3, args, size);
 }
index 7751b7e900a0d2a2fc403eeb791499f36e18685d..9f68304bfbefe33e5859e6d395afc19f9b76139a 100644 (file)
@@ -1673,7 +1673,7 @@ static int lxc_spawn(struct lxc_handler *handler)
        } else {
                int cgroup_fd = -EBADF;
 
-               struct lxc_clone_args clone_args = {
+               struct clone_args clone_args = {
                        .flags = handler->clone_flags,
                        .pidfd = ptr_to_u64(&handler->pidfd),
                        .exit_signal = SIGCHLD,
index 86b4c29a4a9ed5bcbf4ebb2faec967a0167331bd..cd36bc55f17597d7f02fdcd25f6ea8db66d7c674 100644 (file)
@@ -5,7 +5,6 @@
 
 #include "config.h"
 
-#include <linux/sched.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
index 0a07bf467927f9d8dfd9f7d0c9911e93dcee83cb..005e9863d1d7d4132b33ccf6f35acb1e4ebd11b8 100644 (file)
@@ -32,8 +32,6 @@
 
 #include "namespace.h"
 
-#include <sched.h>
-#include <linux/sched.h>
 #include <linux/reboot.h>
 
 int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...);