Skip to content

Commit

Permalink
Merge pull request #720 from talex5/fix-isatty
Browse files Browse the repository at this point in the history
eio_linux: require Linux >= 5.15
  • Loading branch information
talex5 authored Mar 24, 2024
2 parents 911ccc8 + f2ce0c2 commit c53d897
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions lib_eio_linux/eio_linux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,9 @@ module Flow = struct

let close = Eio_unix.Fd.close

let is_tty t = Fd.use_exn "isatty" t Unix.isatty

let stat = Low_level.fstat

let single_read t buf =
if is_tty t then (
(* Work-around for https://github.com/axboe/liburing/issues/354
(should be fixed in Linux 5.14) *)
Low_level.await_readable t
);
Low_level.readv t [buf]

let pread t ~file_offset bufs =
Expand Down
4 changes: 2 additions & 2 deletions lib_eio_linux/sched.ml
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ let with_sched ?(fallback=no_fallback) config fn =
| 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 (
if not (Uring.op_supported probe Uring.Op.mkdirat) then (
Uring.exit uring;
fallback (`Msg "Linux >= 5.11 is required for io_uring support")
fallback (`Msg "Linux >= 5.15 is required for io_uring support")
) else (
statx_works := Uring.op_supported probe Uring.Op.msg_ring;
match
Expand Down

0 comments on commit c53d897

Please sign in to comment.