-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eio_linux: fallback to fork if clone3 is unavailable #524
Conversation
`clone3` is blocked by Docker's default security policy. Also, use `(uintptr_t)` when storing a pointer in a `uint64_t` field, otherwise it doesn't work on 32-bit systems.
This does leave us in a strange half-way house, since we don't derive any benefit from using |
I was going to do that, but the fallback path requires some awkward code to handle the case where you spawn a process and then can't get an FD for it (e.g. due to FD limits), so I decided to use the new system when available. Also, I'm still planning to add support for namespaces at some point (it's OK if that doesn't work in a container). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A path towards supporting namespaces sounds like an excellent reason to keep trying to use clone3. LGTM
return child_pid; /* Success! */ | ||
|
||
if (errno != ENOSYS && errno != EPERM) { | ||
uerror("clone3", Nothing); /* Unknown error */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be fixed everywhere, not just here, but I believe the recommended function from OCaml 5 is caml_uerror
so it's namespaced right. (see ocaml/ocaml@67a4d75).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's do that in a separate PR.
clone3
is blocked by Docker's default security policy.Also, use
(uintptr_t)
when storing a pointer in auint64_t
field, otherwise it doesn't work on 32-bit systems.Fixes #514.