mirror of
https://github.com/ocaml-multicore/eio.git
synced 2025-08-17 00:03:12 -04:00
Compare commits
No commits in common. "f9ba4caf3dd3c8c9d695006df015b9bf12369827" and "f5232a0c17688bde29ab3264c74deeb82af23492" have entirely different histories.
f9ba4caf3d
...
f5232a0c17
@ -270,21 +270,15 @@ let with_chunk ~fallback fn =
|
|||||||
| None ->
|
| None ->
|
||||||
fallback ()
|
fallback ()
|
||||||
|
|
||||||
let rec openat2 ~sw ?seekable ~access ~flags ~perm ~resolve ?dir path =
|
let openat2 ~sw ?seekable ~access ~flags ~perm ~resolve ?dir path =
|
||||||
let use dir_opt =
|
let use dir =
|
||||||
let res = Sched.enter "openat2" (enqueue_openat2 (access, flags, perm, resolve, dir_opt, path)) in
|
let res = Sched.enter "openat2" (enqueue_openat2 (access, flags, perm, resolve, dir, path)) in
|
||||||
if res < 0 then (
|
if res < 0 then (
|
||||||
Switch.check sw; (* If cancelled, report that instead. *)
|
Switch.check sw; (* If cancelled, report that instead. *)
|
||||||
match Uring.error_of_errno res with
|
raise @@ Err.wrap_fs (Uring.error_of_errno res) "openat2" ""
|
||||||
| EAGAIN ->
|
);
|
||||||
(* Linux can return this due to a concurrent update.
|
let fd : Unix.file_descr = Obj.magic res in
|
||||||
It also seems to happen sometimes with no concurrent updates. *)
|
Fd.of_unix ~sw ?seekable ~close_unix:true fd
|
||||||
openat2 ~sw ?seekable ~access ~flags ~perm ~resolve ?dir path
|
|
||||||
| e -> raise @@ Err.wrap_fs e "openat2" ""
|
|
||||||
) else (
|
|
||||||
let fd : Unix.file_descr = Obj.magic res in
|
|
||||||
Fd.of_unix ~sw ?seekable ~close_unix:true fd
|
|
||||||
)
|
|
||||||
in
|
in
|
||||||
match dir with
|
match dir with
|
||||||
| None -> use None
|
| None -> use None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user