Skip to content

Commit

Permalink
Merge pull request #691 from talex5/uring-eperm
Browse files Browse the repository at this point in the history
Handle EPERM when trying to initialise uring
  • Loading branch information
talex5 authored Feb 14, 2024
2 parents 82c47a2 + 7b781b5 commit 43bd3b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib_eio_linux/sched.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 43bd3b8

Please sign in to comment.