···44 "O_DSYNC";
55 "O_RESOLVE_BENEATH";
66 "O_PATH";
77+ "ENOTCAPABLE";
78]
89910let () =
1011 C.main ~name:"discover" (fun c ->
1111- let c_flags = ["-D_LARGEFILE64_SOURCE"; "-D_XOPEN_SOURCE=700"; "-D_DARWIN_C_SOURCE"; "-D_GNU_SOURCE"; "-D_BSD_SOURCE"] in
1212- let includes = ["sys/types.h"; "sys/stat.h"; "fcntl.h"] in
1212+ let c_flags = ["-D_LARGEFILE64_SOURCE"; "-D_XOPEN_SOURCE=700"; "-D_DARWIN_C_SOURCE"; "-D_GNU_SOURCE"; "-D_BSD_SOURCE"; "-D__BSD_VISIBLE"] in
1313+ let includes = ["errno.h"; "sys/types.h"; "sys/stat.h"; "fcntl.h"; "limits.h"] in
1314 let extra_flags, missing_defs =
1415 C.C_define.import c ~c_flags ~includes
1516 C.C_define.Type.(List.map (fun name -> name, Switch) optional_flags)
···2122 )
2223 in
2324 let present_defs =
2424- C.C_define.import c ~c_flags
2525- ~includes:["sys/types.h"; "sys/stat.h"; "fcntl.h"; "limits.h"]
2525+ C.C_define.import c ~c_flags ~includes
2626 C.C_define.Type.(extra_flags @ [
2727 "O_RDONLY", Int;
2828 "O_RDWR", Int;
+5-2
lib_eio_posix/test/open_beneath.ml
···1212 try Ok (L.Resolve.open_unconfined ~sw ~mode (Some dirfd) path flags) with Unix.Unix_error _ as e -> Error e in
1313 let y =
1414 Eio_unix.Fd.use_exn "check" dirfd @@ fun dirfd ->
1515- try Ok (L.Resolve.open_beneath_fallback ~sw ~dirfd ~mode path flags) with Unix.Unix_error _ as e -> Error e
1515+ try Ok (L.Resolve.open_beneath_fallback ~sw ~dirfd ~mode path flags) with
1616+ | Unix.Unix_error _ as e -> Error e
1717+ | Eio.Io _ as e -> Error e
1618 in
1719 match x, y with
1820 | Ok x, Ok y ->
···3032 if x <> y then (
3133 Fmt.failwith "Different errors: %a vs %a" Fmt.exn e1 Fmt.exn e2
3234 )
3333- | Error _, Error _ -> assert false
3535+ | Error (Unix.Unix_error _), Error (Eio.Io (Eio.Fs.E Permission_denied _, _)) -> ()
3636+ | Error e1, Error e2 -> Fmt.failwith "Multiple errors: %a vs %a" Fmt.exn e1 Fmt.exn e2
3437 | Error e, Ok _ -> Fmt.failwith "Only OS open failed: %a" Fmt.exn e
3538 | Ok _, Error e -> Fmt.failwith "Only open_beneath failed: %a" Fmt.exn e
3639