The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #741 from copy/main

define struct clone_args for linux-lts versions that don't have it

authored by

Thomas Leonard and committed by
GitHub
5dcf6dba 5e75c672

+8 -8
+8 -8
vendor/opam/eio/lib_eio_linux/eio_stubs.c
··· 39 39 #ifndef SYS_clone3 40 40 # define SYS_clone3 435 41 41 # define CLONE_PIDFD 0x00001000 42 - struct clone_args { 42 + #endif 43 + 44 + // struct clone_args isn't defined in linux-lts headers, so define it here 45 + // Note that this struct is versioned by size. See linux/sched.h for details 46 + struct caml_eio_clone_args { 43 47 uint64_t flags; 44 48 uint64_t pidfd; 45 49 uint64_t child_tid; ··· 48 52 uint64_t stack; 49 53 uint64_t stack_size; 50 54 uint64_t tls; 51 - uint64_t set_tid; 52 - uint64_t set_tid_size; 53 - uint64_t cgroup; 54 55 }; 55 - #endif 56 56 57 57 // Make sure we have enough space for at least one entry. 58 58 #define DIRENT_BUF_SIZE (PATH_MAX + sizeof(struct dirent64)) ··· 178 178 179 179 /* Like clone3, but falls back to fork if not supported. 180 180 Also, raises exceptions rather then returning an error. */ 181 - static pid_t clone3_with_fallback(struct clone_args *cl_args) { 181 + static pid_t clone3_with_fallback(struct caml_eio_clone_args *cl_args) { 182 182 int *pidfd = (int *)(uintptr_t) cl_args->pidfd; 183 - pid_t child_pid = syscall(SYS_clone3, cl_args, sizeof(struct clone_args)); 183 + pid_t child_pid = syscall(SYS_clone3, cl_args, sizeof(struct caml_eio_clone_args)); 184 184 185 185 if (child_pid >= 0) 186 186 return child_pid; /* Success! */ ··· 216 216 CAMLlocal1(v_result); 217 217 pid_t child_pid; 218 218 int pidfd = -1; /* Is automatically close-on-exec */ 219 - struct clone_args cl_args = { 219 + struct caml_eio_clone_args cl_args = { 220 220 .flags = CLONE_PIDFD, 221 221 .pidfd = (uintptr_t) &pidfd, 222 222 .exit_signal = SIGCHLD, /* Needed for wait4 to work if we exit before exec */