From 7b781b56b67353271ccbe730dae4f709c8065f53 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 14 Feb 2024 09:42:49 +0000 Subject: [PATCH] Handle EPERM when trying to initialise uring This can happen when using a Docker container. --- lib_eio_linux/sched.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_eio_linux/sched.ml b/lib_eio_linux/sched.ml index bce5fd79e..a831a5d54 100644 --- a/lib_eio_linux/sched.ml +++ b/lib_eio_linux/sched.ml @@ -535,7 +535,8 @@ let with_eventfd fn = let with_sched ?(fallback=no_fallback) config fn = let { queue_depth; n_blocks; block_size; polling_timeout } = config in match Uring.create ~queue_depth ?polling_timeout () with - | exception Unix.Unix_error(Unix.ENOSYS, _, _) -> fallback (`Msg "io_uring is not available on this system") + | exception Unix.Unix_error(ENOSYS, _, _) -> fallback (`Msg "io_uring is not available on this system") + | exception Unix.Unix_error(EPERM, _, _) -> fallback (`Msg "io_uring is not available (permission denied)") | uring -> let probe = Uring.get_probe uring in if not (Uring.op_supported probe Uring.Op.shutdown) then (