@@ -360,8 +360,6 @@ external eio_renameat : Unix.file_descr -> string -> Unix.file_descr -> string -
360
360
361
361
external eio_symlinkat : string -> Unix .file_descr -> string -> unit = " caml_eio_symlinkat"
362
362
363
- external eio_fchmodat : Unix .file_descr -> string -> int -> int -> unit = " caml_eio_fchmodat"
364
-
365
363
external eio_getrandom : Cstruct .buffer -> int -> int -> int = " caml_eio_getrandom"
366
364
367
365
external eio_getdents : Unix .file_descr -> string list = " caml_eio_getdents"
@@ -488,15 +486,6 @@ let symlink ~link_to dir path =
488
486
eio_symlinkat link_to parent leaf
489
487
with Unix. Unix_error (code , name , arg ) -> raise @@ Err. wrap_fs code name arg
490
488
491
-
492
- let chmod ~follow ~mode dir path =
493
- let module X = Uring. Statx in
494
- with_parent_dir " chmodat" dir path @@ fun parent leaf ->
495
- let flags = if follow then 0 else (* at_symlink_nofollow *) 0x100 in
496
- try
497
- eio_fchmodat parent leaf mode flags
498
- with Unix. Unix_error (code , name , arg ) -> raise @@ Err. wrap_fs code name arg
499
-
500
489
let shutdown socket command =
501
490
try
502
491
Fd. use_exn " shutdown" socket @@ fun fd ->
@@ -535,6 +524,15 @@ let read_link fd path =
535
524
Eio_unix. run_in_systhread ~label: " read_link" (fun () -> Eio_unix.Private. read_link (Some parent) leaf)
536
525
with Unix. Unix_error (code , name , arg ) -> raise @@ Err. wrap_fs code name arg
537
526
527
+ let chmod ~follow ~mode dir path =
528
+ let module X = Uring. Statx in
529
+ let flags = if follow then X.Flags. empty_path else X.Flags. (empty_path + symlink_nofollow) in
530
+ let flags = (flags :> int ) in
531
+ try
532
+ with_parent_dir_fd dir path @@ fun parent leaf ->
533
+ Eio_unix. run_in_systhread ~label: " chmod" (fun () -> Eio_unix.Private. chmod parent leaf ~mode ~flags )
534
+ with Unix. Unix_error (code , name , arg ) -> raise @@ Err. wrap_fs code name arg
535
+
538
536
(* https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml *)
539
537
let getaddrinfo ~service node =
540
538
let to_eio_sockaddr_t {Unix. ai_family; ai_addr; ai_socktype; ai_protocol; _ } =
0 commit comments