ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
559 stars 72 forks source link

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

Closed copy closed 5 months ago

copy commented 5 months ago

I've chosen to define this struct unconditionally, and rename it:

But I'm open to suggestions for other fixes.

Fixes #737

copy commented 5 months ago

I realised that the original version caused a regression: Using the latest version of the struct unconditionally would break older kernels (at runtime). I've instead changed it to use the first version of the struct. The current code doesn't use any of the new fields (set_tid, set_tid_size and cgroup). If you'd like to check, sizeof caml_eio_clone_args now matches CLONE_ARGS_SIZE_VER0 from linux/sched.h.